File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/node_modules/@material/select/dist/mdc.select.js.map
{"version":3,"sources":["webpack://mdc.[name]/webpack/universalModuleDefinition","webpack://mdc.[name]/webpack/bootstrap","webpack://mdc.[name]/./node_modules/process/browser.js","webpack://mdc.[name]/./node_modules/safevalues/builders/attribute_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/html_sanitizer.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/inert_fragment.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/no_clobber.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.js","webpack://mdc.[name]/./node_modules/safevalues/builders/resource_url_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/script_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/sensitive_attributes.js","webpack://mdc.[name]/./node_modules/safevalues/builders/style_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/style_sheet_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/url_sanitizer.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/anchor.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/area.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/button.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/element.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/embed.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/form.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/iframe.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/input.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/link.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/object.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/script.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/style.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/document.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/dom_parser.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/global.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/location.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/range.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/service_worker_container.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/window.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/worker.js","webpack://mdc.[name]/./node_modules/safevalues/dom/index.js","webpack://mdc.[name]/./node_modules/safevalues/environment/dev.js","webpack://mdc.[name]/./node_modules/safevalues/index.js","webpack://mdc.[name]/./node_modules/safevalues/internals/attribute_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/html_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/resource_url_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/script_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/secrets.js","webpack://mdc.[name]/./node_modules/safevalues/internals/string_literal.js","webpack://mdc.[name]/./node_modules/safevalues/internals/style_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/style_sheet_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/trusted_types.js","webpack://mdc.[name]/./packages/mdc-animation/util.ts","webpack://mdc.[name]/./packages/mdc-base/component.ts","webpack://mdc.[name]/./packages/mdc-base/foundation.ts","webpack://mdc.[name]/./packages/mdc-dom/events.ts","webpack://mdc.[name]/./packages/mdc-dom/keyboard.ts","webpack://mdc.[name]/./packages/mdc-dom/ponyfill.ts","webpack://mdc.[name]/./packages/mdc-floating-label/component.ts","webpack://mdc.[name]/./packages/mdc-floating-label/constants.ts","webpack://mdc.[name]/./packages/mdc-floating-label/foundation.ts","webpack://mdc.[name]/./packages/mdc-line-ripple/component.ts","webpack://mdc.[name]/./packages/mdc-line-ripple/constants.ts","webpack://mdc.[name]/./packages/mdc-line-ripple/foundation.ts","webpack://mdc.[name]/./packages/mdc-list/component.ts","webpack://mdc.[name]/./packages/mdc-list/constants.ts","webpack://mdc.[name]/./packages/mdc-list/events.ts","webpack://mdc.[name]/./packages/mdc-list/foundation.ts","webpack://mdc.[name]/./packages/mdc-list/typeahead.ts","webpack://mdc.[name]/./packages/mdc-menu-surface/component.ts","webpack://mdc.[name]/./packages/mdc-menu-surface/constants.ts","webpack://mdc.[name]/./packages/mdc-menu-surface/foundation.ts","webpack://mdc.[name]/./packages/mdc-menu/component.ts","webpack://mdc.[name]/./packages/mdc-menu/constants.ts","webpack://mdc.[name]/./packages/mdc-menu/foundation.ts","webpack://mdc.[name]/./packages/mdc-notched-outline/component.ts","webpack://mdc.[name]/./packages/mdc-notched-outline/constants.ts","webpack://mdc.[name]/./packages/mdc-notched-outline/foundation.ts","webpack://mdc.[name]/./packages/mdc-ripple/component.ts","webpack://mdc.[name]/./packages/mdc-ripple/constants.ts","webpack://mdc.[name]/./packages/mdc-ripple/foundation.ts","webpack://mdc.[name]/./packages/mdc-ripple/util.ts","webpack://mdc.[name]/./packages/mdc-select/adapter.ts","webpack://mdc.[name]/./packages/mdc-select/component.ts","webpack://mdc.[name]/./packages/mdc-select/constants.ts","webpack://mdc.[name]/./packages/mdc-select/foundation.ts","webpack://mdc.[name]/./packages/mdc-select/helper-text/adapter.ts","webpack://mdc.[name]/./packages/mdc-select/helper-text/component.ts","webpack://mdc.[name]/./packages/mdc-select/helper-text/constants.ts","webpack://mdc.[name]/./packages/mdc-select/helper-text/foundation.ts","webpack://mdc.[name]/./packages/mdc-select/helper-text/index.ts","webpack://mdc.[name]/./packages/mdc-select/icon/adapter.ts","webpack://mdc.[name]/./packages/mdc-select/icon/component.ts","webpack://mdc.[name]/./packages/mdc-select/icon/constants.ts","webpack://mdc.[name]/./packages/mdc-select/icon/foundation.ts","webpack://mdc.[name]/./packages/mdc-select/icon/index.ts","webpack://mdc.[name]/./packages/mdc-select/index.ts","webpack://mdc.[name]/./packages/mdc-select/types.ts"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,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;;;;;;;;;;;;AClFA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLzB;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,6BAA6B,mBAAO,CAAC,0FAAwB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,wCAAwC;AACxC;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;;;AC3Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,gFAAwB;AAClD,0BAA0B,mBAAO,CAAC,gGAAgC;AAClE,oBAAoB,mBAAO,CAAC,oFAA0B;AACtD;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,4BAA4B;AAC5B,4BAA4B;AAC5B,8BAA8B;AAC9B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxFa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,2EAAuB;AAC/B,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA,gBAAgB,mBAAO,CAAC,+EAAyB;AACjD,sBAAsB,mBAAO,CAAC,6EAAkB;AAChD,uBAAuB,mBAAO,CAAC,6FAAkB;AACjD,mBAAmB,mBAAO,CAAC,qFAAc;AACzC,gCAAgC,mBAAO,CAAC,+IAA2C;AACnF,wBAAwB,mBAAO,CAAC,+HAAmC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAqC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4BAA4B,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mHAAmH,2BAA2B;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA,aAAa,EAEJ;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,sBAAsB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,8BAA8B,sGAAsG,EAAE;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,8CAA8C;AACvE;AACA;;;;;;;;;;;;;ACvQa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,gBAAgB,mBAAO,CAAC,+EAAyB;AACjD,uBAAuB,mBAAO,CAAC,6FAAkB;AACjD,gCAAgC,mBAAO,CAAC,+IAA2C;AACnF,wBAAwB,mBAAO,CAAC,+HAAmC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,sBAAsB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uGAAuG,wBAAwB;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA,4DAA4D,UAAU;AACtE;AACA;AACA;AACA;AACA,qDAAqD,UAAU;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,QAAQ,gBAAgB;AACvD;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,sBAAsB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gFAAgF;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,6DAA6D;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6DAA6D;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpNa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,gBAAgB,mBAAO,CAAC,qFAA4B;AACpD,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/Ba;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,wBAAwB,mBAAO,CAAC,+GAAmB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,8EAA8E;AACpG;AACA;AACA;AACA;AACA,sBAAsB,8EAA8E;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,8EAA8E;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8EAA8E;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjPa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,gCAAgC;AAChC;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8FAA8F;;;;;;;;;;;;;ACnDlF;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,0BAA0B,mBAAO,CAAC,gGAAgC;AAClE,oBAAoB,mBAAO,CAAC,oFAA0B;AACtD,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,IAAI;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,0BAA0B;AACpE;AACA;AACA;;;;;;;;;;;;;ACzNa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,oBAAoB,mBAAO,CAAC,oFAA0B;AACtD,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,QAAQ,IAAqC;AAC7C,yCAAyC,iBAAiB,EAAE;AAC5D;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,iDAAiD,qCAAqC,EAAE;AACxF;AACA;AACA;AACA;;;;;;;;;;;;;AC1Fa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,mBAAmB,mBAAO,CAAC,kFAAyB;AACpD;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,MAAM;AACrD;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,yCAAyC;AACzC;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA,eAAe;AACf,8DAA8D;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxDa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,yBAAyB,mBAAO,CAAC,8FAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,2DAA2D;AAC3D;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA,mBAAO,CAAC,wEAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvEa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA,4EAA4E,OAAO;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAO,CAAC,6FAAgC;AAC/D,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD,mBAAmB,mBAAO,CAAC,qFAA4B;AACvD;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iCAAiC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD,EAAE;AAC3G;AACA,qCAAqC,mCAAmC,EAAE;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpIa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACda;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE,oBAAoB,mBAAO,CAAC,uFAA6B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,yBAAyB,mBAAO,CAAC,iGAAkC;AACnE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA,uBAAuB,qBAAqB,eAAe,eAAe;AAC1E,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpCa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,oBAAoB,mBAAO,CAAC,uFAA6B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA,wBAAwB,oBAAoB,eAAe,eAAe;AAC1E,UAAU,UAAU;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB,eAAe;AAC/D,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB,eAAe;AAC7D,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxCa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA,eAAe,kBAAkB,eAAe,aAAa;AAC7D,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA,4EAA4E,OAAO;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,uFAAuF,wDAAwD,EAAE;AACjJ;AACA;;;;;;;;;;;;;AC5Da;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,oCAAoC,aAAa,EAAE;AACjE;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA,yCAAyC,6BAA6B;AACtE,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA,oCAAoC,mBAAO,CAAC,2EAAmB;AAC/D,kCAAkC,mBAAO,CAAC,uEAAiB;AAC3D,oCAAoC,mBAAO,CAAC,2EAAmB;AAC/D,mCAAmC,mBAAO,CAAC,6EAAoB;AAC/D,mCAAmC,mBAAO,CAAC,yEAAkB;AAC7D,kCAAkC,mBAAO,CAAC,uEAAiB;AAC3D,oCAAoC,mBAAO,CAAC,2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C;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,QAAQ,gIAAgI,EAAE;AACxK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC,sBAAsB,mBAAO,CAAC,6EAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3Ea;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B;AACA,gBAAgB,mBAAO,CAAC,iEAAW;AACnC,sBAAsB,mBAAO,CAAC,6EAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,QAAQ,oIAAoI,EAAE;AAC5K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnFa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,8EAA8E;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,8EAA8E;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,UAAU,EAAE;AAC1D,gDAAgD,UAAU,EAAE;AAC5D,mDAAmD,UAAU;AAC7D,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;ACnDG;;;;;;;;;;;;;;;;;;;;;;;;;AAIH,IAAwB;AACb;AACC,kBAAqB;AACrB,kBACT;AAHU;AAIF;AACC,kBAAqB;AACrB,kBACT;AAHU;AAID;AACA,kBAAsB;AACtB,kBAEV;AAJY;AATmC;AAejD,IA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AE;AACR,iBAAQ,QAAQ,QAAW,YAAQ;AACnC,iBAAQ,QAAW,WAAS;AACjC,eAAM;AACD,iBAAQ,QAAQ,QAAW,YAAM,KAAgB;AACjD,iBAAQ,QAAQ,QAAO,QAAE,YAAO,QAAY;AAEpD;AAAC;AAED,sCAAY,eAAZ,UAA0B;AACpB,aAAQ,QAAQ,QAAa,cACnC;AAAC;AAED,sCAAU,aAAV,UAA0B;AACpB,aAAQ,QAAW,WACzB;AAAC;AAED,sCAAiB,oBAAjB,UAA+C;AAC7C,YAAgB,aAAyB,IAAI,QAAY,WAC/B,IAAQ,YAAQ;AAC1C,YAAO,IAAK,SAAY,WAAc,YAAE;AAClC,iBAAQ,QAAoB;AAEpC;AAAC;AACH,WAAC;AAAA,EAjFG,aAiFH;AAlFY,kCAAuB;AAoF6E;AACjH,kBAAuC,wB;;;;;;;;;;;;;AClGpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4FAA0B;AAC1B,gGAA4B;AAC5B,kGAA6B;AAC7B,sCAAmD;AAA3C;2BAAO;AAAe,S;;;;;;;;;;;;;ACL3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uFAA0B;AAC1B,2FAA4B;AAC5B,2FAA4B;AAC5B,6FAA6B;AAC7B,mFAAwB;AACxB,2GAAoC;AACpC,6FAA6B,S;;;;;;;;;;;;;ACR1B","file":"mdc.select.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(\"@material/select\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"select\"] = factory();\n\telse\n\t\troot[\"mdc\"] = root[\"mdc\"] || {}, root[\"mdc\"][\"select\"] = 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/mdc-select/index.ts\");\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeAttrPrefix = void 0;\nrequire(\"../environment/dev\");\nvar attribute_impl_1 = require(\"../internals/attribute_impl\");\nvar string_literal_1 = require(\"../internals/string_literal\");\nvar sensitive_attributes_1 = require(\"./sensitive_attributes\");\n/**\n * Creates a SafeAttributePrefix object from a template literal with no\n * interpolations for attributes that share a common prefix guaranteed to be not\n * security sensitive.\n *\n * The template literal is a prefix that makes it obvious this attribute is not\n * security sensitive. If it doesn't, this function will throw.\n */\nfunction safeAttrPrefix(templ) {\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templ, true, 'safeAttr is a template literal tag function ' +\n 'and should be called using the tagged template syntax. ' +\n 'For example, safeAttr`foo`;');\n }\n var attrPrefix = templ[0].toLowerCase();\n if (process.env.NODE_ENV !== 'production') {\n if (attrPrefix.indexOf('on') === 0 || 'on'.indexOf(attrPrefix) === 0) {\n throw new Error(\"Prefix '\".concat(templ[0], \"' does not guarantee the attribute \") +\n \"to be safe as it is also a prefix for event handler attributes\" +\n \"Please use 'addEventListener' to set event handlers.\");\n }\n sensitive_attributes_1.SECURITY_SENSITIVE_ATTRIBUTES.forEach(function (sensitiveAttr) {\n if (sensitiveAttr.indexOf(attrPrefix) === 0) {\n throw new Error(\"Prefix '\".concat(templ[0], \"' does not guarantee the attribute \") +\n \"to be safe as it is also a prefix for \" +\n \"the security sensitive attribute '\".concat(sensitiveAttr, \"'. \") +\n \"Please use native or safe DOM APIs to set the attribute.\");\n }\n });\n }\n return (0, attribute_impl_1.createAttributePrefix)(attrPrefix);\n}\nexports.safeAttrPrefix = safeAttrPrefix;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatHtmls = exports.createScriptSrc = exports.createScript = exports.htmlEscape = void 0;\nvar html_impl_1 = require(\"../internals/html_impl\");\nvar resource_url_impl_1 = require(\"../internals/resource_url_impl\");\nvar script_impl_1 = require(\"../internals/script_impl\");\n/**\n * Returns HTML-escaped text as a `SafeHtml` object.\n *\n * Available options:\n * - `preserveSpaces` turns every second consecutive space character into its\n * HTML entity representation (` `).\n * - `preserveNewlines` turns newline characters into breaks (`<br>`).\n * - `preserveTabs` wraps tab characters in a span with style=white-space:pre.\n */\nfunction htmlEscape(text, options) {\n if (options === void 0) { options = {}; }\n var htmlEscapedString = htmlEscapeToString(text);\n if (options.preserveSpaces) {\n // Do this first to ensure we preserve spaces after newlines and tabs.\n htmlEscapedString =\n htmlEscapedString.replace(/(^|[\\r\\n\\t ]) /g, '$1 ');\n }\n if (options.preserveNewlines) {\n htmlEscapedString = htmlEscapedString.replace(/(\\r\\n|\\n|\\r)/g, '<br>');\n }\n if (options.preserveTabs) {\n htmlEscapedString = htmlEscapedString.replace(/(\\t+)/g, '<span style=\"white-space:pre\">$1</span>');\n }\n return (0, html_impl_1.createHtml)(htmlEscapedString);\n}\nexports.htmlEscape = htmlEscape;\n/**\n * Creates a `SafeHtml` representing a script tag with inline script content.\n */\nfunction createScript(script, options) {\n if (options === void 0) { options = {}; }\n var unwrappedScript = (0, script_impl_1.unwrapScript)(script).toString();\n var stringTag = \"<script\";\n if (options.id) {\n stringTag += \" id=\\\"\".concat(htmlEscapeToString(options.id), \"\\\"\");\n }\n if (options.nonce) {\n stringTag += \" nonce=\\\"\".concat(htmlEscapeToString(options.nonce), \"\\\"\");\n }\n if (options.type) {\n stringTag += \" type=\\\"\".concat(htmlEscapeToString(options.type), \"\\\"\");\n }\n stringTag += \">\".concat(unwrappedScript, \"</script>\");\n return (0, html_impl_1.createHtml)(stringTag);\n}\nexports.createScript = createScript;\n/**\n * Creates a `SafeHtml` representing a script tag with the src attribute.\n * This also supports CSP nonces and async loading.\n */\nfunction createScriptSrc(src, async, nonce) {\n var unwrappedSrc = (0, resource_url_impl_1.unwrapResourceUrl)(src).toString();\n var stringTag = \"<script src=\\\"\".concat(htmlEscapeToString(unwrappedSrc), \"\\\"\");\n if (async) {\n stringTag += ' async';\n }\n if (nonce) {\n stringTag += \" nonce=\\\"\".concat(htmlEscapeToString(nonce), \"\\\"\");\n }\n stringTag += '>\\x3c/script>';\n return (0, html_impl_1.createHtml)(stringTag);\n}\nexports.createScriptSrc = createScriptSrc;\n/**\n * HTML-escapes the given text (`&`, `<`, `>`, `\"` and `'`).\n */\nfunction htmlEscapeToString(text) {\n var escaped = text.replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n return escaped;\n}\n/** Creates a `SafeHtml` value by concatenating multiple `SafeHtml`s. */\nfunction concatHtmls(htmls) {\n return (0, html_impl_1.createHtml)(htmls.map(html_impl_1.unwrapHtml).join(''));\n}\nexports.concatHtmls = concatHtmls;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sanitizeHtmlToFragment = exports.sanitizeHtmlAssertUnchanged = exports.sanitizeHtml = exports.HtmlSanitizerImpl = void 0;\nrequire(\"../../environment/dev\");\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/* g3_import_pure from '../../internals/pure' */\nvar secrets_1 = require(\"../../internals/secrets\");\nvar url_sanitizer_1 = require(\"../url_sanitizer\");\nvar inert_fragment_1 = require(\"./inert_fragment\");\nvar no_clobber_1 = require(\"./no_clobber\");\nvar default_sanitizer_table_1 = require(\"./sanitizer_table/default_sanitizer_table\");\nvar sanitizer_table_1 = require(\"./sanitizer_table/sanitizer_table\");\n/** Implementation for `HtmlSanitizer` */\nvar HtmlSanitizerImpl = /** @class */ (function () {\n function HtmlSanitizerImpl(sanitizerTable, token) {\n this.sanitizerTable = sanitizerTable;\n this.changes = [];\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n HtmlSanitizerImpl.prototype.sanitizeAssertUnchanged = function (html) {\n this.changes = [];\n var sanitizedHtml = this.sanitize(html);\n if (this.changes.length !== 0) {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message =\n \"Unexpected change to HTML value as a result of sanitization. \" +\n \"Input: \\\"\".concat(html, \"\\\", sanitized output: \\\"\").concat(sanitizedHtml, \"\\\"\\n\") +\n \"List of changes:\".concat(this.changes.join('\\n'));\n }\n throw new Error(message);\n }\n return sanitizedHtml;\n };\n HtmlSanitizerImpl.prototype.sanitize = function (html) {\n var fakeRoot = document.createElement('span');\n fakeRoot.appendChild(this.sanitizeToFragment(html));\n // XML serialization is preferred over HTML serialization as it is\n // stricter and makes sure all attributes are properly escaped, avoiding\n // cases where the tree might mutate when parsed again later due to the\n // complexities of the HTML parsing algorithm\n var serializedNewTree = new XMLSerializer().serializeToString(fakeRoot);\n // We remove the outer most element as this is the span node created as\n // the root for the sanitized tree and contains a spurious xmlns attribute\n // from the XML serialization step.\n serializedNewTree = serializedNewTree.slice(serializedNewTree.indexOf('>') + 1, serializedNewTree.lastIndexOf('</'));\n return (0, html_impl_1.createHtml)(serializedNewTree);\n };\n HtmlSanitizerImpl.prototype.sanitizeToFragment = function (html) {\n var _this = this;\n var dirtyFragment = (0, inert_fragment_1.createInertFragment)(html);\n var treeWalker = document.createTreeWalker(dirtyFragment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, \n // IE10 and IE11 won't accept a proper `NodeFilter` interface, and\n // expect the filtering function to be passed directly. It seems that\n // other browsers also do not mind getting the function directly. see\n // https://stackoverflow.com/q/38245898\n (function (n) { return _this.nodeFilter(n); }), \n // @ts-ignore: error TS2554: Expected 1-3 arguments, but got 4.\n false);\n // `nextNode` is called so we skip the root `DocumentFragment`.\n var currentNode = treeWalker.nextNode();\n // We create a root element to attach all the children of the body to. We\n // use div as it as a semantic-free, generic container and does not\n // represent anything. This is removed when we serialize the tree back\n // into a string.\n var sanitizedFragment = document.createDocumentFragment();\n var sanitizedParent = sanitizedFragment;\n while (currentNode !== null) {\n var sanitizedNode = void 0;\n if ((0, no_clobber_1.isText)(currentNode)) {\n sanitizedNode = this.sanitizeTextNode(currentNode);\n }\n else if ((0, no_clobber_1.isElement)(currentNode)) {\n sanitizedNode = this.sanitizeElementNode(currentNode);\n }\n else {\n throw new Error('Node is not of type text or element');\n }\n sanitizedParent.appendChild(sanitizedNode);\n // Advance iterator while keeping track of the sanitized parent for the\n // current node\n currentNode = treeWalker.firstChild();\n if (currentNode) {\n sanitizedParent = sanitizedNode;\n }\n else {\n while (!(currentNode = treeWalker.nextSibling())) {\n if (!(currentNode = treeWalker.parentNode())) {\n break;\n }\n sanitizedParent = sanitizedParent.parentNode;\n }\n }\n }\n return sanitizedFragment;\n };\n HtmlSanitizerImpl.prototype.sanitizeTextNode = function (textNode) {\n return document.createTextNode(textNode.data);\n };\n HtmlSanitizerImpl.prototype.sanitizeElementNode = function (elementNode) {\n var e_1, _a;\n var elementName = (0, no_clobber_1.getNodeName)(elementNode);\n var newNode = document.createElement(elementName);\n var dirtyAttributes = elementNode.attributes;\n try {\n for (var dirtyAttributes_1 = __values(dirtyAttributes), dirtyAttributes_1_1 = dirtyAttributes_1.next(); !dirtyAttributes_1_1.done; dirtyAttributes_1_1 = dirtyAttributes_1.next()) {\n var _b = dirtyAttributes_1_1.value, name_1 = _b.name, value = _b.value;\n var policy = this.sanitizerTable.getAttributePolicy(name_1, elementName);\n if (!this.satisfiesAllConditions(policy.conditions, dirtyAttributes)) {\n this.recordChange(\"Not all conditions satisfied for attribute: \".concat(name_1, \".\"));\n continue;\n }\n switch (policy.policyAction) {\n case sanitizer_table_1.AttributePolicyAction.KEEP:\n newNode.setAttribute(name_1, value);\n break;\n case sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL:\n var sanitizedAttrUrl = (0, url_sanitizer_1.restrictivelySanitizeUrl)(value);\n if (sanitizedAttrUrl !== value) {\n this.recordChange(\"Url in attribute \".concat(name_1, \" was modified during sanitization. Original url:\\\"\").concat(value, \"\\\" was sanitized to: \\\"\").concat(sanitizedAttrUrl, \"\\\"\"));\n }\n newNode.setAttribute(name_1, sanitizedAttrUrl);\n break;\n case sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE:\n // We don't consider changing the case of an attribute value to be a\n // semantic change\n newNode.setAttribute(name_1, value.toLowerCase());\n break;\n case sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_STYLE:\n newNode.setAttribute(name_1, value);\n break;\n case sanitizer_table_1.AttributePolicyAction.DROP:\n this.recordChange(\"Attribute: \".concat(name_1, \" was dropped\"));\n break;\n default:\n checkExhaustive(policy.policyAction, 'Unhandled AttributePolicyAction case');\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (dirtyAttributes_1_1 && !dirtyAttributes_1_1.done && (_a = dirtyAttributes_1.return)) _a.call(dirtyAttributes_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return newNode;\n };\n HtmlSanitizerImpl.prototype.nodeFilter = function (node) {\n if ((0, no_clobber_1.isText)(node)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n else if (!(0, no_clobber_1.isElement)(node)) {\n // Getting a node that is neither an `Element` or a `Text` node. This is\n // likely due to something that is not supposed to be an element in user\n // code but recognized as such by the TreeWalker (e.g. a polyfill for\n // other kind of nodes). Since we can't recognize it as an element, we\n // drop the node, but we don't record it as a meaningful change.\n return NodeFilter.FILTER_REJECT;\n }\n var nodeName = (0, no_clobber_1.getNodeName)(node);\n if (nodeName === null) {\n this.recordChange(\"Node name was null for node: \".concat(node));\n return NodeFilter.FILTER_REJECT;\n }\n if (this.sanitizerTable.isAllowedElement(nodeName)) {\n return NodeFilter.FILTER_ACCEPT;\n }\n this.recordChange(\"Element: \".concat(nodeName, \" was dropped\"));\n return NodeFilter.FILTER_REJECT;\n };\n HtmlSanitizerImpl.prototype.recordChange = function (errorMessage) {\n if (process.env.NODE_ENV !== 'production') {\n this.changes.push(errorMessage);\n }\n else if (this.changes.length === 0) {\n this.changes.push('');\n }\n };\n HtmlSanitizerImpl.prototype.satisfiesAllConditions = function (conditions, attrs) {\n var e_2, _a;\n var _b;\n if (!conditions) {\n return true;\n }\n try {\n for (var conditions_1 = __values(conditions), conditions_1_1 = conditions_1.next(); !conditions_1_1.done; conditions_1_1 = conditions_1.next()) {\n var _c = __read(conditions_1_1.value, 2), attrName = _c[0], expectedValues = _c[1];\n var value = (_b = attrs.getNamedItem(attrName)) === null || _b === void 0 ? void 0 : _b.value;\n if (value && !expectedValues.has(value)) {\n return false;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (conditions_1_1 && !conditions_1_1.done && (_a = conditions_1.return)) _a.call(conditions_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return true;\n };\n return HtmlSanitizerImpl;\n}());\nexports.HtmlSanitizerImpl = HtmlSanitizerImpl;\nvar defaultHtmlSanitizer = \n/* #__PURE__ */ (function () { return new HtmlSanitizerImpl(default_sanitizer_table_1.defaultSanitizerTable, secrets_1.secretToken); })();\n/** Sanitizes untrusted html using the default sanitizer configuration. */\nfunction sanitizeHtml(html) {\n return defaultHtmlSanitizer.sanitize(html);\n}\nexports.sanitizeHtml = sanitizeHtml;\n/**\n * Sanitizes untrusted html using the default sanitizer configuration. Throws\n * an error if the html was changed.\n */\nfunction sanitizeHtmlAssertUnchanged(html) {\n return defaultHtmlSanitizer.sanitizeAssertUnchanged(html);\n}\nexports.sanitizeHtmlAssertUnchanged = sanitizeHtmlAssertUnchanged;\n/**\n * Sanitizes untrusted html using the default sanitizer configuration. Throws\n * an error if the html was changed.\n */\nfunction sanitizeHtmlToFragment(html) {\n return defaultHtmlSanitizer.sanitizeToFragment(html);\n}\nexports.sanitizeHtmlToFragment = sanitizeHtmlToFragment;\nfunction checkExhaustive(value, msg) {\n if (msg === void 0) { msg = \"unexpected value \".concat(value, \"!\"); }\n throw new Error(msg);\n}\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HtmlSanitizerBuilder = void 0;\nvar secrets_1 = require(\"../../internals/secrets\");\nvar html_sanitizer_1 = require(\"./html_sanitizer\");\nvar default_sanitizer_table_1 = require(\"./sanitizer_table/default_sanitizer_table\");\nvar sanitizer_table_1 = require(\"./sanitizer_table/sanitizer_table\");\n/** This class allows modifications to the default sanitizer configuration. */\nvar HtmlSanitizerBuilder = /** @class */ (function () {\n function HtmlSanitizerBuilder() {\n // To denote if the builder has called build() and therefore should make no\n // further changes to the sanitizer table.\n this.calledBuild = false;\n this.sanitizerTable = default_sanitizer_table_1.defaultSanitizerTable;\n }\n /** Builder option to restrict allowed elements to a smaller subset. */\n HtmlSanitizerBuilder.prototype.onlyAllowElements = function (elementSet) {\n var e_1, _a;\n var allowedElements = new Set();\n var allowedElementPolicies = new Map();\n try {\n for (var elementSet_1 = __values(elementSet), elementSet_1_1 = elementSet_1.next(); !elementSet_1_1.done; elementSet_1_1 = elementSet_1.next()) {\n var element = elementSet_1_1.value;\n element = element.toUpperCase();\n if (!this.sanitizerTable.isAllowedElement(element)) {\n throw new Error(\"Element: \".concat(element, \", is not allowed by html5_contract.textpb\"));\n }\n var elementPolicy = this.sanitizerTable.elementPolicies.get(element);\n if (elementPolicy !== undefined) {\n allowedElementPolicies.set(element, elementPolicy);\n }\n else {\n allowedElements.add(element);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (elementSet_1_1 && !elementSet_1_1.done && (_a = elementSet_1.return)) _a.call(elementSet_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(allowedElements, allowedElementPolicies, this.sanitizerTable.allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies);\n return this;\n };\n /**\n * Builder option to restrict allowed attributes to a smaller subset.\n *\n * If the attribute isn't currently allowed then it won't be added.\n */\n HtmlSanitizerBuilder.prototype.onlyAllowAttributes = function (attributeSet) {\n var e_2, _a, e_3, _b, e_4, _c;\n var allowedGlobalAttributes = new Set();\n var globalAttributePolicies = new Map();\n var elementPolicies = new Map();\n try {\n for (var attributeSet_1 = __values(attributeSet), attributeSet_1_1 = attributeSet_1.next(); !attributeSet_1_1.done; attributeSet_1_1 = attributeSet_1.next()) {\n var attribute = attributeSet_1_1.value;\n if (this.sanitizerTable.allowedGlobalAttributes.has(attribute)) {\n allowedGlobalAttributes.add(attribute);\n }\n if (this.sanitizerTable.globalAttributePolicies.has(attribute)) {\n globalAttributePolicies.set(attribute, this.sanitizerTable.globalAttributePolicies.get(attribute));\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (attributeSet_1_1 && !attributeSet_1_1.done && (_a = attributeSet_1.return)) _a.call(attributeSet_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n try {\n for (var _d = __values(this.sanitizerTable\n .elementPolicies.entries()), _e = _d.next(); !_e.done; _e = _d.next()) {\n var _f = __read(_e.value, 2), elementName = _f[0], originalElementPolicy = _f[1];\n var newElementPolicy = new Map();\n try {\n for (var _g = (e_4 = void 0, __values(originalElementPolicy\n .entries())), _h = _g.next(); !_h.done; _h = _g.next()) {\n var _j = __read(_h.value, 2), attribute = _j[0], attributePolicy = _j[1];\n if (attributeSet.has(attribute)) {\n newElementPolicy.set(attribute, attributePolicy);\n }\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_h && !_h.done && (_c = _g.return)) _c.call(_g);\n }\n finally { if (e_4) throw e_4.error; }\n }\n elementPolicies.set(elementName, newElementPolicy);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_b = _d.return)) _b.call(_d);\n }\n finally { if (e_3) throw e_3.error; }\n }\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies);\n return this;\n };\n /**\n * Allows the set of data attributes passed.\n *\n * These values must be prefixed with \"data-\"\n *\n * If called with onlyAllowElements or onlyAllowAttributes, those methods must\n * be called first.\n */\n HtmlSanitizerBuilder.prototype.allowDataAttributes = function (attributes) {\n var e_5, _a;\n var allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes);\n try {\n for (var attributes_1 = __values(attributes), attributes_1_1 = attributes_1.next(); !attributes_1_1.done; attributes_1_1 = attributes_1.next()) {\n var attribute = attributes_1_1.value;\n if (attribute.indexOf('data-') !== 0) {\n throw new Error(\"data attribute: \".concat(attribute, \" does not begin with the prefix \\\"data-\\\"\"));\n }\n allowedGlobalAttributes.add(attribute);\n }\n }\n catch (e_5_1) { e_5 = { error: e_5_1 }; }\n finally {\n try {\n if (attributes_1_1 && !attributes_1_1.done && (_a = attributes_1.return)) _a.call(attributes_1);\n }\n finally { if (e_5) throw e_5.error; }\n }\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies);\n return this;\n };\n /**\n * Preserves style attributes. Note that the sanitizer won't parse and\n * sanitize the values but keep them as they are. In particular this means\n * that the code will be able to call functions that could do undesirable\n * things (e.g. `url` to trigger a network request), as well as any custom\n * properties or functions defined by the application.\n */\n HtmlSanitizerBuilder.prototype.allowStyleAttributes = function () {\n var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies);\n globalAttributePolicies.set('style', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_STYLE });\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies);\n return this;\n };\n /**\n * Preserves the class attribute on all elements. This means contents can\n * adopt CSS styles from other page elements and possibly mask themselves as\n * legitimate UI elements, which can lead to phishing.\n */\n HtmlSanitizerBuilder.prototype.allowClassAttributes = function () {\n var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies);\n globalAttributePolicies.set('class', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP });\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies);\n return this;\n };\n /**\n * Preserves id attributes. This carries moderate risk as it allows an\n * element to override other elements with the same ID.\n */\n HtmlSanitizerBuilder.prototype.allowIdAttributes = function () {\n var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies);\n globalAttributePolicies.set('id', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP });\n this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies);\n return this;\n };\n HtmlSanitizerBuilder.prototype.build = function () {\n if (this.calledBuild) {\n throw new Error('this sanitizer has already called build');\n }\n this.calledBuild = true;\n return new html_sanitizer_1.HtmlSanitizerImpl(this.sanitizerTable, secrets_1.secretToken);\n };\n return HtmlSanitizerBuilder;\n}());\nexports.HtmlSanitizerBuilder = HtmlSanitizerBuilder;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInertFragment = void 0;\nvar element_1 = require(\"../../dom/elements/element\");\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/**\n * Returns a fragment that contains the parsed HTML for `dirtyHtml` without\n * executing any of the potential payload.\n */\nfunction createInertFragment(dirtyHtml) {\n var template = document.createElement('template');\n // This call is only used to create an inert tree for the sanitizer to\n // further process and is never returned directly to the caller. We can't use\n // a reviewed conversion in order to avoid an import loop.\n var temporarySafeHtml = (0, html_impl_1.createHtml)(dirtyHtml);\n (0, element_1.setInnerHtml)(template, temporarySafeHtml);\n return template.content;\n}\nexports.createInertFragment = createInertFragment;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isElement = exports.isText = exports.getNodeName = void 0;\n/**\n * Library that provides safe getters for different node properties and\n * checks for clobbering.\n */\n/** Gets a reasonable nodeName, even for clobbered nodes. */\nfunction getNodeName(node) {\n var nodeName = node.nodeName;\n // If the property is clobbered, assume it is an `HTMLFormElement`.\n return (typeof nodeName === 'string') ? nodeName : 'FORM';\n}\nexports.getNodeName = getNodeName;\n/** Returns true if the object passed is a Text node. */\nfunction isText(node) {\n // The property cannot get clobbered on Text nodes.\n return node.nodeType === Node.TEXT_NODE;\n}\nexports.isText = isText;\n/** Returns true if the object passed is an Element node. */\nfunction isElement(node) {\n var nodeType = node.nodeType;\n // If the property is clobbered, we can assume it is an `HTMLFormElement`, and\n // thus an `Element`.\n return (nodeType === Node.ELEMENT_NODE) || (typeof nodeType !== 'number');\n}\nexports.isElement = isElement;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultSanitizerTable = void 0;\nvar sanitizer_table_1 = require(\"./sanitizer_table\");\n/**\n * GENERATED CODE, DO NOT MODIFY\n * This SanitizerTable was generated from the checked in html contract:\n * webutil/html/types/codegen/html5_contract.textpb\n *\n * You can regenerate this file with:\n * webutil/html/types/codegen/update_generated_source_files.sh\n */\nexports.defaultSanitizerTable = new sanitizer_table_1.SanitizerTable(new Set([\n 'ARTICLE', 'SECTION', 'NAV', 'ASIDE', 'H1', 'H2',\n 'H3', 'H4', 'H5', 'H6', 'HEADER', 'FOOTER',\n 'ADDRESS', 'P', 'HR', 'PRE', 'BLOCKQUOTE', 'OL',\n 'UL', 'LH', 'LI', 'DL', 'DT', 'DD',\n 'FIGURE', 'FIGCAPTION', 'MAIN', 'DIV', 'EM', 'STRONG',\n 'SMALL', 'S', 'CITE', 'Q', 'DFN', 'ABBR',\n 'RUBY', 'RB', 'RT', 'RTC', 'RP', 'DATA',\n 'TIME', 'CODE', 'VAR', 'SAMP', 'KBD', 'SUB',\n 'SUP', 'I', 'B', 'U', 'MARK', 'BDI',\n 'BDO', 'SPAN', 'BR', 'WBR', 'INS', 'DEL',\n 'PICTURE', 'PARAM', 'TRACK', 'MAP', 'TABLE', 'CAPTION',\n 'COLGROUP', 'COL', 'TBODY', 'THEAD', 'TFOOT', 'TR',\n 'TD', 'TH', 'SELECT', 'DATALIST', 'OPTGROUP', 'OPTION',\n 'OUTPUT', 'PROGRESS', 'METER', 'FIELDSET', 'LEGEND', 'DETAILS',\n 'SUMMARY', 'MENU', 'DIALOG', 'SLOT', 'CANVAS', 'FONT',\n 'CENTER',\n]), new Map([\n [\n 'A', new Map([\n ['href', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'AREA', new Map([\n ['href', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'LINK', new Map([\n [\n 'href', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL,\n conditions: new Map([[\n 'rel', new Set([\n 'alternate',\n 'author',\n 'bookmark',\n 'canonical',\n 'cite',\n 'help',\n 'icon',\n 'license',\n 'next',\n 'prefetch',\n 'dns-prefetch',\n 'prerender',\n 'preconnect',\n 'preload',\n 'prev',\n 'search',\n 'subresource',\n ])\n ]])\n }\n ],\n ])\n ],\n [\n 'SOURCE', new Map([\n ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'IMG', new Map([\n ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'VIDEO', new Map([\n ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n [\n 'AUDIO', new Map([\n ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n ])\n ],\n]), new Set([\n 'title',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-checked',\n 'aria-current',\n 'aria-disabled',\n 'aria-dropeffect',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-label',\n 'aria-level',\n 'aria-live',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext',\n 'alt',\n 'align',\n 'autocapitalize',\n 'autocomplete',\n 'autocorrect',\n 'autofocus',\n 'autoplay',\n 'bgcolor',\n 'border',\n 'cellpadding',\n 'cellspacing',\n 'checked',\n 'color',\n 'cols',\n 'colspan',\n 'controls',\n 'datetime',\n 'disabled',\n 'download',\n 'draggable',\n 'enctype',\n 'face',\n 'formenctype',\n 'frameborder',\n 'height',\n 'hreflang',\n 'hidden',\n 'ismap',\n 'label',\n 'lang',\n 'loop',\n 'max',\n 'maxlength',\n 'media',\n 'minlength',\n 'min',\n 'multiple',\n 'muted',\n 'nonce',\n 'open',\n 'placeholder',\n 'preload',\n 'rel',\n 'required',\n 'reversed',\n 'role',\n 'rows',\n 'rowspan',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'slot',\n 'span',\n 'spellcheck',\n 'start',\n 'step',\n 'summary',\n 'translate',\n 'type',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'itemscope',\n 'itemtype',\n 'itemid',\n 'itemprop',\n 'itemref',\n]), new Map([\n [\n 'dir', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n conditions: new Map([[\n 'dir', new Set([\n 'auto',\n 'ltr',\n 'rtl',\n ])\n ]])\n }\n ],\n [\n 'async', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n conditions: new Map([[\n 'async', new Set([\n 'async',\n ])\n ]])\n }\n ],\n ['cite', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n [\n 'loading', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n conditions: new Map([[\n 'loading', new Set([\n 'eager',\n 'lazy',\n ])\n ]])\n }\n ],\n ['poster', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n [\n 'target', {\n policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n conditions: new Map([[\n 'target', new Set([\n '_self',\n '_blank',\n ])\n ]])\n }\n ],\n]));\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AttributePolicyAction = exports.SanitizerTable = void 0;\n/** Class for holding element and attribute policies used for sanitization. */\nvar SanitizerTable = /** @class */ (function () {\n function SanitizerTable(allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies) {\n this.allowedElements = allowedElements;\n this.elementPolicies = elementPolicies;\n this.allowedGlobalAttributes = allowedGlobalAttributes;\n this.globalAttributePolicies = globalAttributePolicies;\n }\n SanitizerTable.prototype.isAllowedElement = function (elementName) {\n // Note: `HTMLFormElement`s are always dropped, supporting them is very\n // costly because of the DOM clobberring they can cause. The additional code\n // size required to properly work around DOM clobberring issues is large and\n // shouldn't be put on every user of the sanitizer. Thoroughly review\n // b/210975025 and the CLs linked there before you start allowing form\n // elements.\n return elementName.toLowerCase() !== 'form' &&\n (this.allowedElements.has(elementName) ||\n this.elementPolicies.has(elementName));\n };\n SanitizerTable.prototype.getAttributePolicy = function (attributeName, elementName) {\n var elementPolicy = this.elementPolicies.get(elementName);\n if (elementPolicy === null || elementPolicy === void 0 ? void 0 : elementPolicy.has(attributeName)) {\n return elementPolicy.get(attributeName);\n }\n if (this.allowedGlobalAttributes.has(attributeName)) {\n return { policyAction: AttributePolicyAction.KEEP };\n }\n var globalPolicy = this.globalAttributePolicies.get(attributeName);\n return globalPolicy || { policyAction: AttributePolicyAction.DROP };\n };\n return SanitizerTable;\n}());\nexports.SanitizerTable = SanitizerTable;\n/**\n * Values derived from\n * https://godoc.corp.google.com/pkg/google3/third_party/safehtml/sanitizer/policy#AttributePolicy\n */\nvar AttributePolicyAction;\n(function (AttributePolicyAction) {\n AttributePolicyAction[AttributePolicyAction[\"DROP\"] = 0] = \"DROP\";\n AttributePolicyAction[AttributePolicyAction[\"KEEP\"] = 1] = \"KEEP\";\n AttributePolicyAction[AttributePolicyAction[\"KEEP_AND_SANITIZE_URL\"] = 2] = \"KEEP_AND_SANITIZE_URL\";\n AttributePolicyAction[AttributePolicyAction[\"KEEP_AND_NORMALIZE\"] = 3] = \"KEEP_AND_NORMALIZE\";\n AttributePolicyAction[AttributePolicyAction[\"KEEP_AND_SANITIZE_STYLE\"] = 4] = \"KEEP_AND_SANITIZE_STYLE\";\n})(AttributePolicyAction = exports.AttributePolicyAction || (exports.AttributePolicyAction = {}));\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.blobUrlFromScript = exports.replaceFragment = exports.appendParams = exports.trustedResourceUrl = void 0;\nrequire(\"../environment/dev\");\nvar resource_url_impl_1 = require(\"../internals/resource_url_impl\");\nvar script_impl_1 = require(\"../internals/script_impl\");\nvar string_literal_1 = require(\"../internals/string_literal\");\n/**\n * Check whether the base url contains a valid origin,\n *\n * A string for an origin must contain only alphanumeric or any of the\n * following: `-.:`, and must not be an IP address. Remember that, as per the\n * documentation for TrustedResourceUrl, the origin must be trustworthy.\n *\n * @param base The base url that contains an origin.\n */\nfunction hasValidOrigin(base) {\n if (!(/^https:\\/\\//.test(base) || /^\\/\\//.test(base))) {\n return false;\n }\n var originStart = base.indexOf('//') + 2;\n var originEnd = base.indexOf('/', originStart);\n // If the base url only contains the prefix (e.g. //), or the slash\n // for the origin is right after the prefix (e.g. ///), the origin is\n // missing.\n if (originEnd <= originStart) {\n throw new Error(\"Can't interpolate data in a url's origin, \" +\n \"Please make sure to fully specify the origin, terminated with '/'.\");\n }\n var origin = base.substring(originStart, originEnd);\n if (!/^[0-9a-z.:-]+$/i.test(origin)) {\n throw new Error('The origin contains unsupported characters.');\n }\n if (!/^[^:]*(:[0-9]+)?$/i.test(origin)) {\n throw new Error('Invalid port number.');\n }\n if (!/(^|\\.)[a-z][^.]*$/i.test(origin)) {\n throw new Error('The top-level domain must start with a letter.');\n }\n return true;\n}\n/**\n * Check whether the base url contains a valid about url at its beginning.\n *\n * An about url is either exactly 'about:blank' or 'about:blank#<str>' where\n * <str> can be an arbitrary string.\n *\n * @param base The base url.\n */\nfunction isValidAboutUrl(base) {\n if (!/^about:blank/.test(base)) {\n return false;\n }\n if (base !== 'about:blank' && !/^about:blank#/.test(base)) {\n throw new Error('The about url is invalid.');\n }\n return true;\n}\n/**\n * Check whether the base url contains a valid path start at its beginning.\n *\n * A valid path start is either a '/' or a '/' followed by at least one\n * character that is not '/' or '\\'.\n *\n * @param base The base url.\n */\nfunction isValidPathStart(base) {\n if (!/^\\//.test(base)) {\n return false;\n }\n if ((base === '/') ||\n (base.length > 1 && base[1] !== '/' && base[1] !== '\\\\')) {\n return true;\n }\n throw new Error('The path start in the url is invalid.');\n}\n/**\n * Builds TrustedResourceUrl from a template literal.\n *\n * This factory is a template literal tag function. It should be called with\n * a template literal, with or without embedded expressions. For example,\n * trustedResourceUrl`//example.com/${bar}`;\n * or\n * trustedResourceUrl`//example.com`;\n *\n * When this function is called with a template literal without any embedded\n * expressions, the template string may contain anything as the whole URL is\n * a compile-time string constant.\n *\n * When this function is called with a template literal that contains embedded\n * expressions, the template must start with one of the following:\n * - `https://<origin>/`\n * - `//<origin>/`\n * - `/<pathStart>`\n * - `about:blank`\n * - `data:`\n *\n * `<origin>` must contain only alphanumeric or any of the following: `-.:`.\n * Remember that, as per the documentation for TrustedResourceUrl, the origin\n * must be trustworthy. An origin of \"example.com\" could be set with this\n * method, but would tie the security of your site to the security of\n * example.com. Similarly, formats that potentially cover redirects hosted\n * on a trusted origin are problematic, since that could lead to untrusted\n * origins.\n *\n * `<pathStart>` is either an empty string, or a non empty string that does not\n * start with '/' or '\\'.\n * In other words, `/<pathStart>` is either a '/' or a\n * '/' followed by at least one character that is not '/' or '\\'.\n *\n * `data:` (data URL) does not allow embedded expressions in the template\n * literal input.\n *\n * All embedded expressions are URL encoded when they are interpolated. Do not\n * embed expressions that are already URL encoded as they will be double encoded\n * by the builder.\n *\n * @param templateObj This contains the literal part of the template literal.\n * @param rest This represents the template's embedded expressions.\n */\nfunction trustedResourceUrl(templateObj) {\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n // Check if templateObj is actually from a template literal.\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templateObj, true, 'trustedResourceUrl is a template literal tag function and ' +\n 'can only be called as such (e.g. trustedResourceUrl`/somepath.js`)');\n }\n if (rest.length === 0) {\n return (0, resource_url_impl_1.createResourceUrl)(templateObj[0]);\n }\n var base = templateObj[0].toLowerCase();\n if (process.env.NODE_ENV !== 'production') {\n if (/^data:/.test(base)) {\n throw new Error('Data URLs cannot have expressions in the template literal input.');\n }\n if (!hasValidOrigin(base) && !isValidPathStart(base) &&\n !isValidAboutUrl(base)) {\n throw new Error('Trying to interpolate expressions in an unsupported url format.');\n }\n }\n var urlParts = [templateObj[0]];\n for (var i = 0; i < rest.length; i++) {\n urlParts.push(encodeURIComponent(rest[i]));\n urlParts.push(templateObj[i + 1]);\n }\n return (0, resource_url_impl_1.createResourceUrl)(urlParts.join(''));\n}\nexports.trustedResourceUrl = trustedResourceUrl;\n/**\n * Creates a new TrustedResourceUrl with params added to the URL's search\n * parameters.\n *\n * @param params What to add to the URL. Parameters with value `null` or\n * `undefined` are skipped. Both keys and values will be encoded. Do not pass\n * pre-encoded values as this will result them being double encoded. If the\n * value is an array then the same parameter is added for every element in the\n * array.\n */\nfunction appendParams(trustedUrl, params) {\n var url = (0, resource_url_impl_1.unwrapResourceUrl)(trustedUrl).toString();\n if (/#/.test(url)) {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = \"Found a hash in url (\".concat(url, \"), appending not supported\");\n }\n throw new Error(message);\n }\n var separator = /\\?/.test(url) ? '&' : '?';\n // for-of has a big polyfill.\n // tslint:disable-next-line:ban-iterable-foreach\n params.forEach(function (value, key) {\n var values = (value instanceof Array) ? value : [value];\n for (var i = 0; i < values.length; i++) {\n var v = values[i];\n if (v === null || v === undefined) {\n continue;\n }\n url += separator + encodeURIComponent(key) + '=' +\n encodeURIComponent(String(v));\n separator = '&';\n }\n });\n return (0, resource_url_impl_1.createResourceUrl)(url);\n}\nexports.appendParams = appendParams;\nvar BEFORE_FRAGMENT_REGEXP = /[^#]*/;\n/**\n * Creates a new TrustedResourceUrl based on an existing one but with the\n * addition of a fragment (the part after `#`). If the URL already has a\n * fragment, it is replaced with the new one.\n * @param fragment The fragment to add to the URL, verbatim, without the leading\n * `#`. No additional escaping is applied.\n */\nfunction replaceFragment(trustedUrl, fragment) {\n var urlString = (0, resource_url_impl_1.unwrapResourceUrl)(trustedUrl).toString();\n return (0, resource_url_impl_1.createResourceUrl)(BEFORE_FRAGMENT_REGEXP.exec(urlString)[0] + '#' + fragment);\n}\nexports.replaceFragment = replaceFragment;\n/**\n * Creates a `TrustedResourceUrl` by generating a `Blob` from a\n * `SafeScript` and then calling `URL.createObjectURL` with that `Blob`.\n *\n * Caller must call `URL.revokeObjectUrl()` on the stringified url to\n * release the underlying `Blob`.\n */\nfunction blobUrlFromScript(safeScript) {\n var scriptContent = (0, script_impl_1.unwrapScript)(safeScript).toString();\n var blob = new Blob([scriptContent], { type: 'text/javascript' });\n return (0, resource_url_impl_1.createResourceUrl)(URL.createObjectURL(blob));\n}\nexports.blobUrlFromScript = blobUrlFromScript;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeScriptWithArgs = exports.scriptFromJson = exports.concatScripts = exports.safeScript = void 0;\nrequire(\"../environment/dev\");\nvar script_impl_1 = require(\"../internals/script_impl\");\nvar string_literal_1 = require(\"../internals/string_literal\");\n/**\n * Creates a SafeScript object from a template literal (without any embedded\n * expressions).\n *\n * This function is a template literal tag function. It should be called with\n * a template literal that does not contain any expressions. For example,\n * safeScript`foo`;\n *\n * @param templateObj This contains the literal part of the template literal.\n */\nfunction safeScript(templateObj) {\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeScript is a template literal tag function ' +\n 'that only accepts template literals without expressions. ' +\n 'For example, safeScript`foo`;');\n }\n return (0, script_impl_1.createScript)(templateObj[0]);\n}\nexports.safeScript = safeScript;\n/** Creates a `SafeScript` value by concatenating multiple `SafeScript`s. */\nfunction concatScripts(scripts) {\n return (0, script_impl_1.createScript)(scripts.map(script_impl_1.unwrapScript).join(''));\n}\nexports.concatScripts = concatScripts;\n/**\n * Converts a serializable value into JSON that is safe to interpolate into a\n * script context. In particular it escapes < characters so that a value of\n * \"</script>\" doesn't break out of the context.\n * @param value The value to serialize.\n */\nfunction scriptFromJson(value) {\n return (0, script_impl_1.createScript)(JSON.stringify(value).replace(/</g, '\\\\x3c'));\n}\nexports.scriptFromJson = scriptFromJson;\n/**\n * Creates a `SafeScript` object from a template literal (without any embedded\n * expressions) along with additional arguments that the script should have\n * access to. These arguments will be JSON-encoded and passed to the script as\n * a function call.\n * @example\n * ```ts\n * safeScriptWithArgs`function (name, props) {\n * console.log(name + ' is ' + props.age);\n * }`('Bob', { 'age': 42 })\n * ```\n * would return a `SafeScript` that represents the following code:\n * ```js\n * (function (name, props) {\n * console.log(name + ' is ' + props.age);\n * })(\"Bob\",{\"age\":42})\n * ```\n * @note Be careful when passing objects as arguments, as unquoted property\n * names may be changed during compilation.\n * @param templateObj This contains the literal part of the template literal.\n * @param emptyArgs Expressions that evaluate to the empty string to enable\n * inline comments.\n */\nfunction safeScriptWithArgs(templateObj) {\n var emptyArgs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n emptyArgs[_i - 1] = arguments[_i];\n }\n if (process.env.NODE_ENV !== 'production') {\n if (emptyArgs.some(function (a) { return a !== ''; })) {\n throw new Error('safeScriptWithArgs only allows empty string expressions ' +\n 'to enable inline comments.');\n }\n (0, string_literal_1.assertIsTemplateObject)(templateObj, true, 'safeScriptWithArgs is a template literal tag function ' +\n 'that only accepts template literals. ' +\n 'For example, safeScriptWithArgs`foo`;');\n }\n return function () {\n var argValues = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n argValues[_i] = arguments[_i];\n }\n var values = argValues.map(function (v) { return scriptFromJson(v).toString(); });\n return (0, script_impl_1.createScript)(\"(\".concat(templateObj.join(''), \")(\").concat(values.join(','), \")\"));\n };\n}\nexports.safeScriptWithArgs = safeScriptWithArgs;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SECURITY_SENSITIVE_ATTRIBUTES = void 0;\n// AUTOGENERATED. DO NOT EDIT.\n/**\n * Security sensitive attribute names that should not be set through\n * `setAttribute` or similar functions.\n */\nexports.SECURITY_SENSITIVE_ATTRIBUTES = [\n 'href',\n 'rel',\n 'src',\n 'srcdoc',\n 'action',\n 'formaction',\n 'sandbox',\n 'cite',\n 'poster',\n 'icon',\n];\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatStyles = exports.safeStyle = void 0;\nrequire(\"../environment/dev\");\nvar string_literal_1 = require(\"../internals/string_literal\");\nvar style_impl_1 = require(\"../internals/style_impl\");\n/**\n * Creates a SafeStyle object from a template literal (without any embedded\n * expressions).\n *\n * ` style` should be in the format\n * ` name: value; [name: value; ...]` and must not have any < or >\n * characters in it. This is so that SafeStyle's contract is preserved,\n * allowing the SafeStyle to correctly be interpreted as a sequence of CSS\n * declarations and without affecting the syntactic structure of any\n * surrounding CSS and HTML.\n *\n * This function is a template literal tag function. It should be called with\n * a template literal that does not contain any expressions. For example,\n * safeStyle`foo`;\n * This function first checks if it is called with a literal template, and\n * then performs basic sanity checks on the format of ` style`\n * but does not constrain the format of ` name} and {@code value`, except\n * for disallowing tag characters.\n *\n * @param templateObj This contains the literal part of the template literal.\n */\nfunction safeStyle(templateObj) {\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyle is a template literal tag function ' +\n 'that only accepts template literals without expressions. ' +\n 'For example, safeStyle`foo`;');\n }\n var style = templateObj[0];\n if (process.env.NODE_ENV !== 'production') {\n if (/[<>]/.test(style)) {\n throw new Error('Forbidden characters in style string: ' + style);\n }\n if (!/;$/.test(style)) {\n throw new Error('Style string does not end with \";\": ' + style);\n }\n if (!/:/.test(style)) {\n throw new Error('Style string should contain one or more \":\": ' + style);\n }\n }\n return (0, style_impl_1.createStyle)(style);\n}\nexports.safeStyle = safeStyle;\n/** Creates a `SafeStyle` value by concatenating multiple `SafeStyle`s. */\nfunction concatStyles(styles) {\n return (0, style_impl_1.createStyle)(styles.map(style_impl_1.unwrapStyle).join(''));\n}\nexports.concatStyles = concatStyles;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatStyleSheets = exports.safeStyleSheet = void 0;\nrequire(\"../environment/dev\");\nvar string_literal_1 = require(\"../internals/string_literal\");\nvar style_sheet_impl_1 = require(\"../internals/style_sheet_impl\");\n/**\n * Creates a SafeStyleSheet object from a template literal (without any\n * embedded expressions).\n *\n * This function is a template literal tag function. It should be called with\n * a template literal that does not contain any expressions. For example,\n * safeStyleSheet`foo`;\n * The argument must not have any < or > characters in it. This is so that\n * SafeStyleSheet's contract is preserved, allowing the SafeStyleSheet to\n * correctly be interpreted as a sequence of CSS declarations and without\n * affecting the syntactic structure of any surrounding CSS and HTML.\n *\n * @param templateObj This contains the literal part of the template literal.\n */\nfunction safeStyleSheet(templateObj) {\n if (process.env.NODE_ENV !== 'production') {\n (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyleSheet is a template literal tag ' +\n 'function that only accepts template literals without ' +\n 'expressions. For example, safeStyleSheet`foo`;');\n }\n var styleSheet = templateObj[0];\n if (process.env.NODE_ENV !== 'production') {\n if (/[<>]/.test(styleSheet)) {\n throw new Error('Forbidden characters in styleSheet string: ' + styleSheet);\n }\n }\n return (0, style_sheet_impl_1.createStyleSheet)(styleSheet);\n}\nexports.safeStyleSheet = safeStyleSheet;\n/**\n * Creates a `SafeStyleSheet` value by concatenating multiple `SafeStyleSheet`s.\n */\nfunction concatStyleSheets(sheets) {\n return (0, style_sheet_impl_1.createStyleSheet)(sheets.map(style_sheet_impl_1.unwrapStyleSheet).join(''));\n}\nexports.concatStyleSheets = concatStyleSheets;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.restrictivelySanitizeUrl = exports.unwrapUrlOrSanitize = exports.sanitizeJavascriptUrl = void 0;\n/**\n * @fileoverview Provides functions to enforce the SafeUrl contract at the sink\n * level.\n */\nrequire(\"../environment/dev\");\nfunction extractScheme(url) {\n var parsedUrl;\n try {\n parsedUrl = new URL(url);\n }\n catch (e) {\n // According to https://url.spec.whatwg.org/#constructors, the URL\n // constructor with one parameter throws if `url` is not absolute. In this\n // case, we are sure that no explicit scheme (javascript: ) is set.\n // This can also be a URL parsing error, but in this case the URL won't be\n // run anyway.\n return 'https:';\n }\n return parsedUrl.protocol;\n}\n// We can't use an ES6 Set here because gws somehow depends on this code and\n// doesn't want to pay the cost of a polyfill.\nvar ALLOWED_SCHEMES = ['data:', 'http:', 'https:', 'mailto:', 'ftp:'];\n/**\n * Checks that the URL scheme is not javascript.\n * The URL parsing relies on the URL API in browsers that support it.\n * @param url The URL to sanitize for a SafeUrl sink.\n * @return undefined if url has a javascript: scheme, the original URL\n * otherwise.\n */\nfunction sanitizeJavascriptUrl(url) {\n var parsedScheme = extractScheme(url);\n if (parsedScheme === 'javascript:') {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\"A URL with content '\".concat(url, \"' was sanitized away.\"));\n }\n return undefined;\n }\n return url;\n}\nexports.sanitizeJavascriptUrl = sanitizeJavascriptUrl;\n/**\n * Adapter to sanitize string URLs in DOM sink wrappers.\n * @return undefined if the URL was sanitized.\n */\nfunction unwrapUrlOrSanitize(url) {\n return sanitizeJavascriptUrl(url);\n}\nexports.unwrapUrlOrSanitize = unwrapUrlOrSanitize;\n/**\n * Sanitizes a URL restrictively.\n * This sanitizer protects against XSS and potentially other uncommon and\n * undesirable schemes that an attacker could use for e.g. phishing (tel:,\n * callto: ssh: etc schemes). This sanitizer is primarily meant to be used by\n * the HTML sanitizer.\n */\nfunction restrictivelySanitizeUrl(url) {\n var parsedScheme = extractScheme(url);\n if (parsedScheme !== undefined &&\n ALLOWED_SCHEMES.indexOf(parsedScheme.toLowerCase()) !== -1) {\n return url;\n }\n return 'about:invalid#zClosurez';\n}\nexports.restrictivelySanitizeUrl = restrictivelySanitizeUrl;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setHref = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Href attribute from the given Url.\n */\nfunction setHref(anchor, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n anchor.href = sanitizedUrl;\n }\n}\nexports.setHref = setHref;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setHref = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Href attribute from the given Url.\n */\nfunction setHref(area, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n area.href = sanitizedUrl;\n }\n}\nexports.setHref = setHref;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setFormaction = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Formaction attribute from the given Url.\n */\nfunction setFormaction(button, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n button.formAction = sanitizedUrl;\n }\n}\nexports.setFormaction = setFormaction;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setPrefixedAttribute = exports.buildPrefixedAttributeSetter = exports.insertAdjacentHtml = exports.setCssText = exports.setOuterHtml = exports.setInnerHtml = void 0;\n/**\n * @fileoverview This contains safe wrappers for properties that aren't specific\n * to one kind of HTMLElement (like innerHTML), plus other setters and functions\n * that are not tied to elements (like location.href or Worker constructor).\n */\nvar attribute_impl_1 = require(\"../../internals/attribute_impl\");\nvar html_impl_1 = require(\"../../internals/html_impl\");\nvar style_impl_1 = require(\"../../internals/style_impl\");\n/**\n * Safely set {@link Element.innerHTML} on a given ShadowRoot or Element which\n * may not be a `<script>` element or a `<style>` element.\n */\nfunction setInnerHtml(elOrRoot, v) {\n if (isElement(elOrRoot)) {\n throwIfScriptOrStyle(elOrRoot);\n }\n elOrRoot.innerHTML = (0, html_impl_1.unwrapHtml)(v);\n}\nexports.setInnerHtml = setInnerHtml;\n/**\n * Safely set {@link Element.outerHTML} for the given Element.\n */\nfunction setOuterHtml(e, v) {\n var parent = e.parentElement;\n if (parent !== null) {\n throwIfScriptOrStyle(parent);\n }\n e.outerHTML = (0, html_impl_1.unwrapHtml)(v);\n}\nexports.setOuterHtml = setOuterHtml;\n/**\n * Set `ElementCSSInlineStyle.cssText` for the given `ElementCSSInlineStyle`.\n */\nfunction setCssText(e, v) {\n e.style.cssText = (0, style_impl_1.unwrapStyle)(v);\n}\nexports.setCssText = setCssText;\n/**\n * Safely call {@link Element.insertAdjacentHTML} for the given Element.\n */\nfunction insertAdjacentHtml(element, position, v) {\n var tagContext = (position === 'beforebegin' || position === 'afterend') ?\n element.parentElement :\n element;\n if (tagContext !== null) {\n throwIfScriptOrStyle(tagContext);\n }\n element.insertAdjacentHTML(position, (0, html_impl_1.unwrapHtml)(v));\n}\nexports.insertAdjacentHtml = insertAdjacentHtml;\n/**\n * Given a set of known-to-be-safe prefixes (e.g., \"data-\", \"aria-\", \"js\"),\n * return a setter function that allows you to set attributes on an element,\n * as long as the names of the attributes to be set has one of the prefixes.\n *\n * The returned setter ensures that setting any dangerous attribute, e.g.,\n * \"src\", \"href\" will cause an exception. This is intended to be used as the\n * safe alterantive of `Element#setAttribute`, when applications need to set\n * attributes that do not have security implications and do not have a\n * corresponding DOM property.\n */\nfunction buildPrefixedAttributeSetter(prefix) {\n var otherPrefixes = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n otherPrefixes[_i - 1] = arguments[_i];\n }\n var prefixes = __spreadArray([prefix], __read(otherPrefixes), false);\n return function (e, attr, value) {\n setPrefixedAttribute(prefixes, e, attr, value);\n };\n}\nexports.buildPrefixedAttributeSetter = buildPrefixedAttributeSetter;\n/**\n * The safe alternative to Element#setAttribute. The function takes a list of\n * `SafeAttributePrefix`, making developer intention explicit. The attribute\n * to be set must has one of the safe prefixes, otherwise the function throws\n * an Error.\n */\nfunction setPrefixedAttribute(attrPrefixes, e, attr, value) {\n if (attrPrefixes.length === 0) {\n throw new Error('No prefixes are provided');\n }\n var prefixes = attrPrefixes.map(function (s) { return (0, attribute_impl_1.unwrapAttributePrefix)(s); });\n var attrLower = attr.toLowerCase();\n if (prefixes.every(function (p) { return attrLower.indexOf(p) !== 0; })) {\n throw new Error(\"Attribute \\\"\".concat(attr, \"\\\" does not match any of the allowed prefixes.\"));\n }\n e.setAttribute(attr, value);\n}\nexports.setPrefixedAttribute = setPrefixedAttribute;\nfunction throwIfScriptOrStyle(element) {\n if (element.tagName.toLowerCase() === 'script') {\n throw new Error('Use setTextContent with a SafeScript.');\n }\n else if (element.tagName.toLowerCase() === 'style') {\n throw new Error('Use setTextContent with a SafeStyleSheet.');\n }\n}\nfunction isElement(elOrRoot) {\n return elOrRoot.tagName !== undefined;\n}\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setSrc = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/**\n * Sets the Src attribute from the given SafeUrl.\n */\nfunction setSrc(embedEl, url) {\n embedEl.src = (0, resource_url_impl_1.unwrapResourceUrl)(url);\n}\nexports.setSrc = setSrc;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setAction = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Action attribute from the given Url.\n */\nfunction setAction(form, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n form.action = sanitizedUrl;\n }\n}\nexports.setAction = setAction;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setSrcdoc = exports.setSrc = void 0;\n/**\n * @fileoverview Safe iframe helpers and go/intents-for-iframes-for-closure\n */\nvar html_impl_1 = require(\"../../internals/html_impl\");\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/** Sets the Src attribute using a TrustedResourceUrl */\nfunction setSrc(iframe, v) {\n iframe.src = (0, resource_url_impl_1.unwrapResourceUrl)(v).toString();\n}\nexports.setSrc = setSrc;\n/** Sets the Srcdoc attribute using a SafeHtml */\nfunction setSrcdoc(iframe, v) {\n iframe.srcdoc = (0, html_impl_1.unwrapHtml)(v);\n}\nexports.setSrcdoc = setSrcdoc;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setFormaction = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Formaction attribute from the given Url.\n */\nfunction setFormaction(input, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n input.formAction = sanitizedUrl;\n }\n}\nexports.setFormaction = setFormaction;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setHrefAndRel = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\nvar SAFE_URL_REL_VALUES = [\n 'alternate',\n 'author',\n 'bookmark',\n 'canonical',\n 'cite',\n 'help',\n 'icon',\n 'license',\n 'next',\n 'prefetch',\n 'dns-prefetch',\n 'prerender',\n 'preconnect',\n 'preload',\n 'prev',\n 'search',\n 'subresource',\n];\nfunction setHrefAndRel(link, url, rel) {\n if (url instanceof resource_url_impl_1.TrustedResourceUrl) {\n link.href = (0, resource_url_impl_1.unwrapResourceUrl)(url).toString();\n }\n else {\n if (SAFE_URL_REL_VALUES.indexOf(rel) === -1) {\n throw new Error(\"TrustedResourceUrl href attribute required with rel=\\\"\".concat(rel, \"\\\"\"));\n }\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl === undefined) {\n return;\n }\n link.href = sanitizedUrl;\n }\n link.rel = rel;\n}\nexports.setHrefAndRel = setHrefAndRel;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setData = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/** Sets the data attribute using a TrustedResourceUrl */\nfunction setData(obj, v) {\n obj.data = (0, resource_url_impl_1.unwrapResourceUrl)(v);\n}\nexports.setData = setData;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setSrc = exports.setTextContent = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\nvar script_impl_1 = require(\"../../internals/script_impl\");\n/** Returns CSP nonce, if set for any script tag. */\nfunction getScriptNonceFromWindow(win) {\n var _a;\n var doc = win.document;\n // document.querySelector can be undefined in non-browser environments.\n var script = (_a = doc.querySelector) === null || _a === void 0 ? void 0 : _a.call(doc, 'script[nonce]');\n if (script) {\n // Try to get the nonce from the IDL property first, because browsers that\n // implement additional nonce protection features (currently only Chrome) to\n // prevent nonce stealing via CSS do not expose the nonce via attributes.\n // See https://github.com/whatwg/html/issues/2369\n return script['nonce'] || script.getAttribute('nonce') || '';\n }\n return '';\n}\n/** Propagates CSP nonce to dynamically created scripts. */\nfunction setNonceForScriptElement(script) {\n var win = script.ownerDocument && script.ownerDocument.defaultView;\n var nonce = getScriptNonceFromWindow(win || window);\n if (nonce) {\n script.setAttribute('nonce', nonce);\n }\n}\n/** Sets textContent from the given SafeScript. */\nfunction setTextContent(script, v) {\n script.textContent = (0, script_impl_1.unwrapScript)(v);\n setNonceForScriptElement(script);\n}\nexports.setTextContent = setTextContent;\n/** Sets the Src attribute using a TrustedResourceUrl */\nfunction setSrc(script, v) {\n script.src = (0, resource_url_impl_1.unwrapResourceUrl)(v);\n setNonceForScriptElement(script);\n}\nexports.setSrc = setSrc;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setTextContent = void 0;\nvar style_sheet_impl_1 = require(\"../../internals/style_sheet_impl\");\n/** Safe setters for `HTMLStyleElement`s. */\nfunction setTextContent(elem, safeStyleSheet) {\n elem.textContent = (0, style_sheet_impl_1.unwrapStyleSheet)(safeStyleSheet);\n}\nexports.setTextContent = setTextContent;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.execCommandInsertHtml = exports.execCommand = exports.write = void 0;\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/**\n * write safely calls {@link Document.write} on the given {@link Document} with\n * the given {@link SafeHtml}.\n */\nfunction write(doc, text) {\n doc.write((0, html_impl_1.unwrapHtml)(text));\n}\nexports.write = write;\n/**\n * Safely calls {@link Document.execCommand}. When command is insertHtml, a\n * SafeHtml must be passed in as value.\n */\nfunction execCommand(doc, command, value) {\n var commandString = String(command);\n var valueArgument = value;\n if (commandString.toLowerCase() === 'inserthtml') {\n valueArgument = (0, html_impl_1.unwrapHtml)(value);\n }\n return doc.execCommand(commandString, /* showUi= */ false, valueArgument);\n}\nexports.execCommand = execCommand;\n/**\n * Safely calls {@link Document.execCommand}('insertHtml').\n * @deprecated Use safeDocument.execCommand.\n */\nfunction execCommandInsertHtml(doc, html) {\n return doc.execCommand('insertHTML', /* showUi= */ false, (0, html_impl_1.unwrapHtml)(html));\n}\nexports.execCommandInsertHtml = execCommandInsertHtml;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseFromString = exports.parseHtml = void 0;\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/** Safely parses a string using the HTML parser. */\nfunction parseHtml(parser, html) {\n return parseFromString(parser, html, 'text/html');\n}\nexports.parseHtml = parseHtml;\n/** Safely parses a string using the HTML or XML parser. */\nfunction parseFromString(parser, content, contentType) {\n return parser.parseFromString((0, html_impl_1.unwrapHtml)(content), contentType);\n}\nexports.parseFromString = parseFromString;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.globalEval = void 0;\nvar script_impl_1 = require(\"../../internals/script_impl\");\n/**\n * Evaluates a SafeScript value in the given scope using eval.\n *\n * Strongly consider avoiding this, as eval blocks CSP adoption and does not\n * benefit from compiler optimizations.\n */\nfunction globalEval(win, script) {\n var trustedScript = (0, script_impl_1.unwrapScript)(script);\n var result = win.eval(trustedScript);\n if (result === trustedScript) {\n // https://crbug.com/1024786 manifesting in workers.\n result = win.eval(trustedScript.toString());\n }\n return result;\n}\nexports.globalEval = globalEval;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assign = exports.replace = exports.setHref = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * setHref safely sets {@link Location.href} on the given {@link Location} with\n * given {@link Url}.\n */\nfunction setHref(loc, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n loc.href = sanitizedUrl;\n }\n}\nexports.setHref = setHref;\n/**\n * replace safely calls {@link Location.replace} on the given {@link Location}\n * with given {@link Url}.\n */\nfunction replace(loc, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n loc.replace(sanitizedUrl);\n }\n}\nexports.replace = replace;\n/**\n * assign safely calls {@link Location.assign} on the given {@link Location}\n * with given {@link Url}.\n */\nfunction assign(loc, url) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n loc.assign(sanitizedUrl);\n }\n}\nexports.assign = assign;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createContextualFragment = void 0;\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/** Safely creates a contextualFragment. */\nfunction createContextualFragment(range, html) {\n return range.createContextualFragment((0, html_impl_1.unwrapHtml)(html));\n}\nexports.createContextualFragment = createContextualFragment;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.register = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/** Safely registers a service worker by URL */\nfunction register(container, scriptURL, options) {\n return container.register((0, resource_url_impl_1.unwrapResourceUrl)(scriptURL), options);\n}\nexports.register = register;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.open = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * open calls {@link Window.open} on the given {@link Window}, given a\n * target {@link Url}.\n */\nfunction open(win, url, target, features) {\n var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n if (sanitizedUrl !== undefined) {\n return win.open(sanitizedUrl, target, features);\n }\n return null;\n}\nexports.open = open;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.importScripts = exports.createShared = exports.create = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/**\n * Safely creates a Web Worker.\n *\n * Example usage:\n * const trustedResourceUrl = trustedResourceUrl`/safe_script.js`;\n * safedom.safeWorker.create(trustedResourceUrl);\n * which is a safe alternative to\n * new Worker(url);\n * The latter can result in loading untrusted code.\n */\nfunction create(url, options) {\n return new Worker((0, resource_url_impl_1.unwrapResourceUrl)(url), options);\n}\nexports.create = create;\n/** Safely creates a shared Web Worker. */\nfunction createShared(url, options) {\n return new SharedWorker((0, resource_url_impl_1.unwrapResourceUrl)(url), options);\n}\nexports.createShared = createShared;\n/** Safely calls importScripts */\nfunction importScripts(scope) {\n var urls = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n urls[_i - 1] = arguments[_i];\n }\n scope.importScripts.apply(scope, __spreadArray([], __read(urls.map(function (url) { return (0, resource_url_impl_1.unwrapResourceUrl)(url); })), false));\n}\nexports.importScripts = importScripts;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeWorker = exports.safeWindow = exports.safeServiceWorkerContainer = exports.safeRange = exports.safeLocation = exports.safeGlobal = exports.safeDomParser = exports.safeDocument = exports.safeStyleEl = exports.safeScriptEl = exports.safeObjectEl = exports.safeLinkEl = exports.safeInputEl = exports.safeIframeEl = exports.safeFormEl = exports.safeEmbedEl = exports.safeElement = exports.safeButtonEl = exports.safeAreaEl = exports.safeAnchorEl = void 0;\n/**\n * @fileoverview This file re-exports all of the wrappers to ensure that we have\n * a clearly defined interface.\n */\nexports.safeAnchorEl = __importStar(require(\"./elements/anchor\"));\nexports.safeAreaEl = __importStar(require(\"./elements/area\"));\nexports.safeButtonEl = __importStar(require(\"./elements/button\"));\nexports.safeElement = __importStar(require(\"./elements/element\"));\nexports.safeEmbedEl = __importStar(require(\"./elements/embed\"));\nexports.safeFormEl = __importStar(require(\"./elements/form\"));\nexports.safeIframeEl = __importStar(require(\"./elements/iframe\"));\nexports.safeInputEl = __importStar(require(\"./elements/input\"));\nexports.safeLinkEl = __importStar(require(\"./elements/link\"));\nexports.safeObjectEl = __importStar(require(\"./elements/object\"));\nexports.safeScriptEl = __importStar(require(\"./elements/script\"));\nexports.safeStyleEl = __importStar(require(\"./elements/style\"));\nexports.safeDocument = __importStar(require(\"./globals/document\"));\nexports.safeDomParser = __importStar(require(\"./globals/dom_parser\"));\nexports.safeGlobal = __importStar(require(\"./globals/global\"));\nexports.safeLocation = __importStar(require(\"./globals/location\"));\nexports.safeRange = __importStar(require(\"./globals/range\"));\nexports.safeServiceWorkerContainer = __importStar(require(\"./globals/service_worker_container\"));\nexports.safeWindow = __importStar(require(\"./globals/window\"));\nexports.safeWorker = __importStar(require(\"./globals/worker\"));\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Ensure process.env.NODE_ENV is set even when not running under Webpack or\n * Node. Terser will strip this out of production binaries.\n */\n/*#__PURE__*/ (function () {\n if (typeof process === 'undefined') {\n window.process = { env: { NODE_ENV: 'development' } };\n }\n})();\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapStyleSheet = exports.SafeStyleSheet = exports.isStyleSheet = exports.unwrapStyle = exports.SafeStyle = exports.isStyle = exports.unwrapScript = exports.SafeScript = exports.isScript = exports.EMPTY_SCRIPT = exports.unwrapResourceUrl = exports.TrustedResourceUrl = exports.isResourceUrl = exports.unwrapHtml = exports.SafeHtml = exports.isHtml = exports.EMPTY_HTML = exports.unwrapAttributePrefix = exports.SafeAttributePrefix = exports.safeStyleSheet = exports.concatStyleSheets = exports.safeStyle = exports.concatStyles = exports.scriptFromJson = exports.safeScriptWithArgs = exports.safeScript = exports.concatScripts = exports.trustedResourceUrl = exports.replaceFragment = exports.blobUrlFromScript = exports.appendParams = exports.HtmlSanitizerBuilder = exports.sanitizeHtmlToFragment = exports.sanitizeHtmlAssertUnchanged = exports.sanitizeHtml = exports.htmlEscape = exports.createScriptSrc = exports.createScript = exports.concatHtmls = exports.safeAttrPrefix = void 0;\n/** Safe builders */\nvar attribute_builders_1 = require(\"./builders/attribute_builders\");\nObject.defineProperty(exports, \"safeAttrPrefix\", { enumerable: true, get: function () { return attribute_builders_1.safeAttrPrefix; } });\nvar html_builders_1 = require(\"./builders/html_builders\");\nObject.defineProperty(exports, \"concatHtmls\", { enumerable: true, get: function () { return html_builders_1.concatHtmls; } });\nObject.defineProperty(exports, \"createScript\", { enumerable: true, get: function () { return html_builders_1.createScript; } });\nObject.defineProperty(exports, \"createScriptSrc\", { enumerable: true, get: function () { return html_builders_1.createScriptSrc; } });\nObject.defineProperty(exports, \"htmlEscape\", { enumerable: true, get: function () { return html_builders_1.htmlEscape; } });\nvar html_sanitizer_1 = require(\"./builders/html_sanitizer/html_sanitizer\");\nObject.defineProperty(exports, \"sanitizeHtml\", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtml; } });\nObject.defineProperty(exports, \"sanitizeHtmlAssertUnchanged\", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtmlAssertUnchanged; } });\nObject.defineProperty(exports, \"sanitizeHtmlToFragment\", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtmlToFragment; } });\nvar html_sanitizer_builder_1 = require(\"./builders/html_sanitizer/html_sanitizer_builder\");\nObject.defineProperty(exports, \"HtmlSanitizerBuilder\", { enumerable: true, get: function () { return html_sanitizer_builder_1.HtmlSanitizerBuilder; } });\nvar resource_url_builders_1 = require(\"./builders/resource_url_builders\");\nObject.defineProperty(exports, \"appendParams\", { enumerable: true, get: function () { return resource_url_builders_1.appendParams; } });\nObject.defineProperty(exports, \"blobUrlFromScript\", { enumerable: true, get: function () { return resource_url_builders_1.blobUrlFromScript; } });\nObject.defineProperty(exports, \"replaceFragment\", { enumerable: true, get: function () { return resource_url_builders_1.replaceFragment; } });\nObject.defineProperty(exports, \"trustedResourceUrl\", { enumerable: true, get: function () { return resource_url_builders_1.trustedResourceUrl; } });\nvar script_builders_1 = require(\"./builders/script_builders\");\nObject.defineProperty(exports, \"concatScripts\", { enumerable: true, get: function () { return script_builders_1.concatScripts; } });\nObject.defineProperty(exports, \"safeScript\", { enumerable: true, get: function () { return script_builders_1.safeScript; } });\nObject.defineProperty(exports, \"safeScriptWithArgs\", { enumerable: true, get: function () { return script_builders_1.safeScriptWithArgs; } });\nObject.defineProperty(exports, \"scriptFromJson\", { enumerable: true, get: function () { return script_builders_1.scriptFromJson; } });\nvar style_builders_1 = require(\"./builders/style_builders\");\nObject.defineProperty(exports, \"concatStyles\", { enumerable: true, get: function () { return style_builders_1.concatStyles; } });\nObject.defineProperty(exports, \"safeStyle\", { enumerable: true, get: function () { return style_builders_1.safeStyle; } });\nvar style_sheet_builders_1 = require(\"./builders/style_sheet_builders\");\nObject.defineProperty(exports, \"concatStyleSheets\", { enumerable: true, get: function () { return style_sheet_builders_1.concatStyleSheets; } });\nObject.defineProperty(exports, \"safeStyleSheet\", { enumerable: true, get: function () { return style_sheet_builders_1.safeStyleSheet; } });\n/** Types, constants and unwrappers */\nvar attribute_impl_1 = require(\"./internals/attribute_impl\");\nObject.defineProperty(exports, \"SafeAttributePrefix\", { enumerable: true, get: function () { return attribute_impl_1.SafeAttributePrefix; } });\nObject.defineProperty(exports, \"unwrapAttributePrefix\", { enumerable: true, get: function () { return attribute_impl_1.unwrapAttributePrefix; } });\nvar html_impl_1 = require(\"./internals/html_impl\");\nObject.defineProperty(exports, \"EMPTY_HTML\", { enumerable: true, get: function () { return html_impl_1.EMPTY_HTML; } });\nObject.defineProperty(exports, \"isHtml\", { enumerable: true, get: function () { return html_impl_1.isHtml; } });\nObject.defineProperty(exports, \"SafeHtml\", { enumerable: true, get: function () { return html_impl_1.SafeHtml; } });\nObject.defineProperty(exports, \"unwrapHtml\", { enumerable: true, get: function () { return html_impl_1.unwrapHtml; } });\nvar resource_url_impl_1 = require(\"./internals/resource_url_impl\");\nObject.defineProperty(exports, \"isResourceUrl\", { enumerable: true, get: function () { return resource_url_impl_1.isResourceUrl; } });\nObject.defineProperty(exports, \"TrustedResourceUrl\", { enumerable: true, get: function () { return resource_url_impl_1.TrustedResourceUrl; } });\nObject.defineProperty(exports, \"unwrapResourceUrl\", { enumerable: true, get: function () { return resource_url_impl_1.unwrapResourceUrl; } });\nvar script_impl_1 = require(\"./internals/script_impl\");\nObject.defineProperty(exports, \"EMPTY_SCRIPT\", { enumerable: true, get: function () { return script_impl_1.EMPTY_SCRIPT; } });\nObject.defineProperty(exports, \"isScript\", { enumerable: true, get: function () { return script_impl_1.isScript; } });\nObject.defineProperty(exports, \"SafeScript\", { enumerable: true, get: function () { return script_impl_1.SafeScript; } });\nObject.defineProperty(exports, \"unwrapScript\", { enumerable: true, get: function () { return script_impl_1.unwrapScript; } });\nvar style_impl_1 = require(\"./internals/style_impl\");\nObject.defineProperty(exports, \"isStyle\", { enumerable: true, get: function () { return style_impl_1.isStyle; } });\nObject.defineProperty(exports, \"SafeStyle\", { enumerable: true, get: function () { return style_impl_1.SafeStyle; } });\nObject.defineProperty(exports, \"unwrapStyle\", { enumerable: true, get: function () { return style_impl_1.unwrapStyle; } });\nvar style_sheet_impl_1 = require(\"./internals/style_sheet_impl\");\nObject.defineProperty(exports, \"isStyleSheet\", { enumerable: true, get: function () { return style_sheet_impl_1.isStyleSheet; } });\nObject.defineProperty(exports, \"SafeStyleSheet\", { enumerable: true, get: function () { return style_sheet_impl_1.SafeStyleSheet; } });\nObject.defineProperty(exports, \"unwrapStyleSheet\", { enumerable: true, get: function () { return style_sheet_impl_1.unwrapStyleSheet; } });\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapAttributePrefix = exports.createAttributePrefix = exports.SafeAttributePrefix = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\n/** A prefix with which an attribute is safe to set using plain strings. */\nvar SafeAttributePrefix = /** @class */ (function () {\n function SafeAttributePrefix() {\n }\n return SafeAttributePrefix;\n}());\nexports.SafeAttributePrefix = SafeAttributePrefix;\n/** Implementation for `SafeAttributePrefix` */\nvar AttributePrefixImpl = /** @class */ (function (_super) {\n __extends(AttributePrefixImpl, _super);\n function AttributePrefixImpl(attrPrefix, token) {\n var _this = _super.call(this) || this;\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n _this.privateDoNotAccessOrElseWrappedAttrPrefix = attrPrefix;\n return _this;\n }\n AttributePrefixImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedAttrPrefix;\n };\n return AttributePrefixImpl;\n}(SafeAttributePrefix));\n/**\n * Builds a new `SafeAttribute` from the given string, without enforcing\n * safety guarantees. This shouldn't be exposed to application developers, and\n * must only be used as a step towards safe builders or safe constants.\n */\nfunction createAttributePrefix(attrPrefix) {\n return new AttributePrefixImpl(attrPrefix, secrets_1.secretToken);\n}\nexports.createAttributePrefix = createAttributePrefix;\n/**\n * Returns the string value of the passed `SafeAttributePrefix` object while\n * ensuring it has the correct type.\n */\nfunction unwrapAttributePrefix(value) {\n if (value instanceof AttributePrefixImpl) {\n return value.privateDoNotAccessOrElseWrappedAttrPrefix;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeAttributePrefix';\n }\n throw new Error(message);\n }\n}\nexports.unwrapAttributePrefix = unwrapAttributePrefix;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapHtml = exports.isHtml = exports.EMPTY_HTML = exports.createHtml = exports.SafeHtml = void 0;\nrequire(\"../environment/dev\");\n/* g3_import_pure from './pure' */\nvar secrets_1 = require(\"./secrets\");\nvar trusted_types_1 = require(\"./trusted_types\");\n/**\n * Runtime implementation of `TrustedHTML` in browsers that don't support it.\n */\nvar HtmlImpl = /** @class */ (function () {\n function HtmlImpl(html, token) {\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n this.privateDoNotAccessOrElseWrappedHtml = html;\n }\n HtmlImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedHtml.toString();\n };\n return HtmlImpl;\n}());\nfunction createHtmlInternal(html, trusted) {\n return (trusted !== null && trusted !== void 0 ? trusted : new HtmlImpl(html, secrets_1.secretToken));\n}\nvar GlobalTrustedHTML = (typeof window !== undefined) ? window.TrustedHTML : undefined;\n/**\n * Also exports the constructor so that instanceof checks work.\n */\nexports.SafeHtml = (GlobalTrustedHTML !== null && GlobalTrustedHTML !== void 0 ? GlobalTrustedHTML : HtmlImpl);\n/**\n * Builds a new `SafeHtml` from the given string, without enforcing safety\n * guarantees. It may cause side effects by creating a Trusted Types policy.\n * This shouldn't be exposed to application developers, and must only be used as\n * a step towards safe builders or safe constants.\n */\nfunction createHtml(html) {\n var _a;\n /** @noinline */\n var noinlineHtml = html;\n return createHtmlInternal(noinlineHtml, (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createHTML(noinlineHtml));\n}\nexports.createHtml = createHtml;\n/**\n * An empty `SafeHtml` constant.\n * Unlike the function above, using this will not create a policy.\n */\nexports.EMPTY_HTML = \n/* #__PURE__ */ (function () { var _a; return createHtmlInternal('', (_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.emptyHTML); })();\n/**\n * Checks if the given value is a `SafeHtml` instance.\n */\nfunction isHtml(value) {\n return value instanceof exports.SafeHtml;\n}\nexports.isHtml = isHtml;\n/**\n * Returns the value of the passed `SafeHtml` object while ensuring it\n * has the correct type.\n *\n * Returns a native `TrustedHTML` or a string if Trusted Types are disabled.\n */\nfunction unwrapHtml(value) {\n var _a;\n if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isHTML(value)) {\n return value;\n }\n else if (value instanceof HtmlImpl) {\n return value.privateDoNotAccessOrElseWrappedHtml;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeHtml';\n }\n throw new Error(message);\n }\n}\nexports.unwrapHtml = unwrapHtml;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapResourceUrl = exports.isResourceUrl = exports.createResourceUrl = exports.TrustedResourceUrl = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\nvar trusted_types_1 = require(\"./trusted_types\");\n/**\n * Runtime implementation of `TrustedScriptURL` in browsers that don't support\n * it.\n */\nvar ResourceUrlImpl = /** @class */ (function () {\n function ResourceUrlImpl(url, token) {\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n this.privateDoNotAccessOrElseWrappedResourceUrl = url;\n }\n ResourceUrlImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedResourceUrl.toString();\n };\n return ResourceUrlImpl;\n}());\nvar GlobalTrustedScriptURL = (typeof window !== undefined) ? window.TrustedScriptURL : undefined;\n/**\n * Also exports the constructor so that instanceof checks work.\n */\nexports.TrustedResourceUrl = (GlobalTrustedScriptURL !== null && GlobalTrustedScriptURL !== void 0 ? GlobalTrustedScriptURL : ResourceUrlImpl);\n/**\n * Builds a new `TrustedResourceUrl` from the given string, without\n * enforcing safety guarantees. It may cause side effects by creating a Trusted\n * Types policy. This shouldn't be exposed to application developers, and must\n * only be used as a step towards safe builders or safe constants.\n */\nfunction createResourceUrl(url) {\n var _a;\n /** @noinline */\n var noinlineUrl = url;\n var trustedScriptURL = (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createScriptURL(noinlineUrl);\n return (trustedScriptURL !== null && trustedScriptURL !== void 0 ? trustedScriptURL : new ResourceUrlImpl(noinlineUrl, secrets_1.secretToken));\n}\nexports.createResourceUrl = createResourceUrl;\n/**\n * Checks if the given value is a `TrustedResourceUrl` instance.\n */\nfunction isResourceUrl(value) {\n return value instanceof exports.TrustedResourceUrl;\n}\nexports.isResourceUrl = isResourceUrl;\n/**\n * Returns the value of the passed `TrustedResourceUrl` object while ensuring it\n * has the correct type.\n *\n * Returns a native `TrustedScriptURL` or a string if Trusted Types are\n * disabled.\n */\nfunction unwrapResourceUrl(value) {\n var _a;\n if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScriptURL(value)) {\n return value;\n }\n else if (value instanceof ResourceUrlImpl) {\n return value.privateDoNotAccessOrElseWrappedResourceUrl;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping TrustedResourceUrl';\n }\n throw new Error(message);\n }\n}\nexports.unwrapResourceUrl = unwrapResourceUrl;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapScript = exports.isScript = exports.EMPTY_SCRIPT = exports.createScript = exports.SafeScript = void 0;\nrequire(\"../environment/dev\");\n/* g3_import_pure from './pure' */\nvar secrets_1 = require(\"./secrets\");\nvar trusted_types_1 = require(\"./trusted_types\");\n/**\n * Runtime implementation of `TrustedScript` in browswers that don't support it.\n * script element.\n */\nvar ScriptImpl = /** @class */ (function () {\n function ScriptImpl(script, token) {\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n this.privateDoNotAccessOrElseWrappedScript = script;\n }\n ScriptImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedScript.toString();\n };\n return ScriptImpl;\n}());\nfunction createScriptInternal(script, trusted) {\n return (trusted !== null && trusted !== void 0 ? trusted : new ScriptImpl(script, secrets_1.secretToken));\n}\nvar GlobalTrustedScript = (typeof window !== undefined) ? window.TrustedScript : undefined;\n/**\n * Also exports the constructor so that instanceof checks work.\n */\nexports.SafeScript = (GlobalTrustedScript !== null && GlobalTrustedScript !== void 0 ? GlobalTrustedScript : ScriptImpl);\n/**\n * Builds a new `SafeScript` from the given string, without enforcing\n * safety guarantees. It may cause side effects by creating a Trusted Types\n * policy. This shouldn't be exposed to application developers, and must only be\n * used as a step towards safe builders or safe constants.\n */\nfunction createScript(script) {\n var _a;\n /** @noinline */\n var noinlineScript = script;\n return createScriptInternal(noinlineScript, (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createScript(noinlineScript));\n}\nexports.createScript = createScript;\n/**\n * An empty `SafeScript` constant.\n * Unlike the functions above, using this will not create a policy.\n */\nexports.EMPTY_SCRIPT = \n/* #__PURE__ */ (function () { var _a; return createScriptInternal('', (_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.emptyScript); })();\n/**\n * Checks if the given value is a `SafeScript` instance.\n */\nfunction isScript(value) {\n return value instanceof exports.SafeScript;\n}\nexports.isScript = isScript;\n/**\n * Returns the value of the passed `SafeScript` object while ensuring it\n * has the correct type.\n *\n * Returns a native `TrustedScript` or a string if Trusted Types are disabled.\n */\nfunction unwrapScript(value) {\n var _a;\n if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScript(value)) {\n return value;\n }\n else if (value instanceof ScriptImpl) {\n return value.privateDoNotAccessOrElseWrappedScript;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeScript';\n }\n throw new Error(message);\n }\n}\nexports.unwrapScript = unwrapScript;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ensureTokenIsValid = exports.secretToken = void 0;\n/**\n * A secret token that must be passed to safe type constructors. It is only\n * accessible from within safevalues, ensuring that unrestricted safe type\n * creation is only possible within safevalues. In particular, this prevents\n * forgery such as `safeHtmlValue.constructor('javascript:evil')`.\n */\nexports.secretToken = {};\n/**\n * Asserts that the given token matches the secret safevalues token. An\n * exception is thrown if that is not the case.\n */\nfunction ensureTokenIsValid(token) {\n if (token !== exports.secretToken) {\n throw new Error('Bad secret');\n }\n}\nexports.ensureTokenIsValid = ensureTokenIsValid;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assertIsTemplateObject = void 0;\n/**\n * An object of type TemplateStringsArray represents the literal part(s) of a\n * template literal. This function checks if a TemplateStringsArray object is\n * actually from a template literal.\n *\n * @param templateObj This contains the literal part of the template literal.\n * @param hasExprs If true, the input template may contain embedded expressions.\n * @param errorMsg The custom error message in case any checks fail.\n */\nfunction assertIsTemplateObject(templateObj, hasExprs, errorMsg) {\n if (!Array.isArray(templateObj) || !Array.isArray(templateObj.raw) ||\n (!hasExprs && templateObj.length !== 1)) {\n throw new TypeError(errorMsg);\n }\n}\nexports.assertIsTemplateObject = assertIsTemplateObject;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapStyle = exports.isStyle = exports.createStyle = exports.SafeStyle = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\n/**\n * Sequence of CSS declarations safe to use in style contexts in an HTML\n * document or in DOM APIs.\n */\nvar SafeStyle = /** @class */ (function () {\n function SafeStyle() {\n }\n return SafeStyle;\n}());\nexports.SafeStyle = SafeStyle;\n/** Implementation for `SafeStyle` */\nvar StyleImpl = /** @class */ (function (_super) {\n __extends(StyleImpl, _super);\n function StyleImpl(style, token) {\n var _this = _super.call(this) || this;\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n _this.privateDoNotAccessOrElseWrappedStyle = style;\n return _this;\n }\n StyleImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedStyle;\n };\n return StyleImpl;\n}(SafeStyle));\n/**\n * Builds a new `SafeStyle` from the given string, without enforcing\n * safety guarantees. This shouldn't be exposed to application developers, and\n * must only be used as a step towards safe builders or safe constants.\n */\nfunction createStyle(style) {\n return new StyleImpl(style, secrets_1.secretToken);\n}\nexports.createStyle = createStyle;\n/**\n * Checks if the given value is a `SafeStyle` instance.\n */\nfunction isStyle(value) {\n return value instanceof StyleImpl;\n}\nexports.isStyle = isStyle;\n/**\n * Returns the string value of the passed `SafeStyle` object while ensuring it\n * has the correct type.\n */\nfunction unwrapStyle(value) {\n if (value instanceof StyleImpl) {\n return value.privateDoNotAccessOrElseWrappedStyle;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeStyle';\n }\n throw new Error(message);\n }\n}\nexports.unwrapStyle = unwrapStyle;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapStyleSheet = exports.isStyleSheet = exports.createStyleSheet = exports.SafeStyleSheet = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\n/**\n * A complete CSS style sheet, safe to use in style contexts in an HTML document\n * or DOM APIs.\n */\nvar SafeStyleSheet = /** @class */ (function () {\n function SafeStyleSheet() {\n }\n return SafeStyleSheet;\n}());\nexports.SafeStyleSheet = SafeStyleSheet;\n/** Implementation for `SafeStyleSheet` */\nvar StyleSheetImpl = /** @class */ (function (_super) {\n __extends(StyleSheetImpl, _super);\n function StyleSheetImpl(styleSheet, token) {\n var _this = _super.call(this) || this;\n if (process.env.NODE_ENV !== 'production') {\n (0, secrets_1.ensureTokenIsValid)(token);\n }\n _this.privateDoNotAccessOrElseWrappedStyleSheet = styleSheet;\n return _this;\n }\n StyleSheetImpl.prototype.toString = function () {\n return this.privateDoNotAccessOrElseWrappedStyleSheet;\n };\n return StyleSheetImpl;\n}(SafeStyleSheet));\n/**\n * Builds a new `SafeStyleSheet` from the given string, without enforcing\n * safety guarantees. This shouldn't be exposed to application developers, and\n * must only be used as a step towards safe builders or safe constants.\n */\nfunction createStyleSheet(styleSheet) {\n return new StyleSheetImpl(styleSheet, secrets_1.secretToken);\n}\nexports.createStyleSheet = createStyleSheet;\n/**\n * Checks if the given value is a `SafeStyleSheet` instance.\n */\nfunction isStyleSheet(value) {\n return value instanceof StyleSheetImpl;\n}\nexports.isStyleSheet = isStyleSheet;\n/**\n * Returns the string value of the passed `SafeStyleSheet` object while\n * ensuring it has the correct type.\n */\nfunction unwrapStyleSheet(value) {\n if (value instanceof StyleSheetImpl) {\n return value.privateDoNotAccessOrElseWrappedStyleSheet;\n }\n else {\n var message = '';\n if (process.env.NODE_ENV !== 'production') {\n message = 'Unexpected type when unwrapping SafeStyleSheet';\n }\n throw new Error(message);\n }\n}\nexports.unwrapStyleSheet = unwrapStyleSheet;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TEST_ONLY = exports.getTrustedTypesPolicy = exports.getTrustedTypes = void 0;\n/**\n * The name of the Trusted Types policy used by TS safevalues, or empty\n * to disable Trusted Types. This duplicates the 'google#safe', but\n * can be overridden in tests.\n */\nvar trustedTypesPolicyName = 'google#safe';\n/** Helper to retrieve the value of `window.trustedTypes`. */\nfunction trustedTypes() {\n if (typeof window !== 'undefined') {\n return window.trustedTypes;\n }\n return undefined;\n}\n/**\n * Returns window.trustedTypes if Trusted Types are enabled and supported, or\n * null otherwise.\n */\nfunction getTrustedTypes() {\n var _a;\n return (trustedTypesPolicyName !== '') ? ((_a = trustedTypes()) !== null && _a !== void 0 ? _a : null) : null;\n}\nexports.getTrustedTypes = getTrustedTypes;\n/**\n * The Trusted Types policy used by TS safevalues, or null if Trusted Types\n * are not enabled/supported, or undefined if the policy has not been created\n * yet.\n */\nvar trustedTypesPolicy;\n/**\n * Returns the Trusted Types policy used by TS safevalues, or null if Trusted\n * Types are not enabled/supported. The first call to this function will\n * create the policy.\n */\nfunction getTrustedTypesPolicy() {\n var _a, _b;\n if (trustedTypesPolicy === undefined) {\n try {\n trustedTypesPolicy =\n (_b = (_a = getTrustedTypes()) === null || _a === void 0 ? void 0 : _a.createPolicy(trustedTypesPolicyName, {\n createHTML: function (s) { return s; },\n createScript: function (s) { return s; },\n createScriptURL: function (s) { return s; }\n })) !== null && _b !== void 0 ? _b : null;\n }\n catch (_c) {\n // In Chromium versions before 81, trustedTypes.createPolicy throws if\n // called with a name that is already registered, even if no CSP is set.\n // Until users have largely migrated to 81 or above, catch the error not\n // to break the applications functionally. In such case, the code will\n // fall back to using regular Safe Types.\n trustedTypesPolicy = null;\n }\n }\n return trustedTypesPolicy;\n}\nexports.getTrustedTypesPolicy = getTrustedTypesPolicy;\n/** Helpers for tests. */\nexports.TEST_ONLY = {\n resetDefaults: function () {\n trustedTypesPolicy = undefined;\n trustedTypesPolicyName = 'google#safe';\n },\n setTrustedTypesPolicyName: function (name) {\n trustedTypesPolicyName = name;\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 {CssVendorPropertyMap, JsVendorPropertyMap, PrefixedCssPropertyName, PrefixedJsEventType, StandardCssPropertyName, StandardJsEventType} 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) &&\n typeof windowObj.document.createElement === 'function';\n}\n\nexport function getCorrectPropertyName(\n 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(\n windowObj: Window, eventType: StandardJsEventType): StandardJsEventType|\n 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 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 {safeAttrPrefix} from 'safevalues';\nimport {safeElement} from 'safevalues/dom';\n\nimport {MDCFoundation} from './foundation';\nimport {CustomEventListener, EventType, SpecificEventListener} from './types';\n\nfunction toCamelCase(str: string) {\n // tslint:disable-next-line:enforce-name-casing\n return String(str).replace(/\\-([a-z])/g, (_, match) => match.toUpperCase());\n}\n\n/** MDC Component base */\nexport class MDCComponent<FoundationType extends MDCFoundation> {\n static attachTo(root: HTMLElement): MDCComponent<MDCFoundation<{}>> {\n // Subclasses which extend MDCBase should provide an attachTo() method that\n // takes a root element and returns an instantiated component with its root\n // set to that element. Also note that in the cases of subclasses, an\n // explicit foundation class will not have to be passed in; it will simply\n // be initialized from getDefaultFoundation().\n return new MDCComponent(root, new MDCFoundation({}));\n }\n\n protected foundation: FoundationType;\n\n constructor(\n public root: HTMLElement, foundation?: FoundationType,\n ...args: unknown[]) {\n this.initialize(...args);\n // Note that we initialize foundation here and not within the constructor's\n // default param so that this.root is defined and can be used within the\n // foundation class.\n this.foundation =\n 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\n * not need to be unit tested */\n // tslint:disable-next-line:enforce-name-casing\n initialize(..._args: unknown[]) {\n // Subclasses can override this to do any additional setup work that would\n // be considered part of a \"constructor\". Essentially, it is a hook into the\n // parent constructor before the foundation is initialized. Any additional\n // 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\n // foundation class for the component.\n throw new Error(\n '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\n // synchronize with a host DOM object. An example of this would be a form\n // control wrapper that needs to synchronize its internal state to some\n // property or attribute of the host DOM. Please note: this is *not* the\n // place to perform DOM reads/writes that would cause layout / paint, as\n // this is called synchronously from within the constructor.\n }\n\n destroy() {\n // Subclasses may implement this method to release any resources /\n // deregister any listeners they have attached. An example of this might be\n // 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.\n * This is most useful when listening for custom events.\n */\n listen<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>,\n options?: AddEventListenerOptions|boolean): void;\n listen<E extends Event>(\n evtType: string, handler: CustomEventListener<E>,\n options?: AddEventListenerOptions|boolean): void;\n listen(\n evtType: string, handler: EventListener,\n 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.\n * This is most useful when unlistening for custom events.\n */\n unlisten<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>,\n options?: AddEventListenerOptions|boolean): void;\n unlisten<E extends Event>(\n evtType: string, handler: CustomEventListener<E>,\n options?: AddEventListenerOptions|boolean): void;\n unlisten(\n evtType: string, handler: EventListener,\n 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\n * 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 * This is a intermediate fix to allow components to use safevalues. This\n * limits setAttribute to setting tabindex, data attributes, and aria\n * attributes.\n *\n * TODO(b/263990206): remove this method and add these directly in each\n * component. This will remove this abstraction and make it clear that the\n * caller can't set any attribute.\n */\n protected safeSetAttribute(\n element: HTMLElement,\n attribute: string,\n value: string,\n ) {\n if (attribute.toLowerCase() === 'tabindex') {\n element.tabIndex = Number(value);\n } else if (attribute.indexOf('data-') === 0) {\n const dataKey = toCamelCase(attribute.replace(/^data-/, ''));\n element.dataset[dataKey] = value;\n } else {\n safeElement.setPrefixedAttribute(\n [safeAttrPrefix`aria-`, safeAttrPrefix`role`],\n element,\n attribute,\n value,\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 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\n/** MDC Foundation */\nexport class MDCFoundation<AdapterType extends {} = {}> {\n static get cssClasses(): {[key: string]: string} {\n // Classes extending MDCFoundation should implement this method to return an\n // object which exports every CSS class the foundation class needs as a\n // 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\n // object which exports all semantic strings as constants. e.g. {ARIA_ROLE:\n // 'tablist'}\n return {};\n }\n\n static get numbers(): {[key: string]: number} {\n // Classes extending MDCFoundation should implement this method to return an\n // object which exports all of its semantic numbers as constants.\n // 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\n // order to provide a convenient way of viewing the necessary methods of an\n // adapter. In the future, this could also be used for adapter validation.\n return {};\n }\n\n constructor(protected adapter: AdapterType = {} as AdapterType) {}\n\n init() {\n // Subclasses should override this method to perform initialization routines\n // (registering events, etc.)\n }\n\n destroy() {\n // Subclasses should override this method to perform de-initialization\n // routines (de-registering events, etc.)\n }\n}\n\n/**\n * The constructor for MDCFoundation.\n */\nexport interface MDCFoundationConstructor<AdapterType extends object = any> {\n new(adapter: AdapterType): MDCFoundation<AdapterType>;\n readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * The deprecated constructor for MDCFoundation.\n */\nexport interface MDCFoundationDeprecatedConstructor<\n AdapterType extends object = any> {\n readonly cssClasses: Record<string, string>;\n readonly strings: Record<string, string>;\n readonly numbers: Record<string, number>;\n readonly defaultAdapter: AdapterType;\n\n new(adapter?: Partial<AdapterType>): MDCFoundation<AdapterType>;\n readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * Retrieves the AdapaterType from the provided MDCFoundation generic type.\n */\nexport type MDCFoundationAdapter<T> =\n T extends MDCFoundation<infer A>? A : never;\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\n/**\n * Determine whether the current browser supports passive event listeners, and\n * if so, use them.\n */\nexport function applyPassive(globalObj: Window = window): boolean|\n 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\n/**\n * KEY provides normalized string values for keys.\n */\nexport const KEY = {\n UNKNOWN: 'Unknown',\n BACKSPACE: 'Backspace',\n ENTER: 'Enter',\n SPACEBAR: 'Spacebar',\n PAGE_UP: 'PageUp',\n PAGE_DOWN: 'PageDown',\n END: 'End',\n HOME: 'Home',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_UP: 'ArrowUp',\n ARROW_RIGHT: 'ArrowRight',\n ARROW_DOWN: 'ArrowDown',\n DELETE: 'Delete',\n ESCAPE: 'Escape',\n TAB: 'Tab',\n};\n\nconst normalizedKeys = new Set<string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nnormalizedKeys.add(KEY.BACKSPACE);\nnormalizedKeys.add(KEY.ENTER);\nnormalizedKeys.add(KEY.SPACEBAR);\nnormalizedKeys.add(KEY.PAGE_UP);\nnormalizedKeys.add(KEY.PAGE_DOWN);\nnormalizedKeys.add(KEY.END);\nnormalizedKeys.add(KEY.HOME);\nnormalizedKeys.add(KEY.ARROW_LEFT);\nnormalizedKeys.add(KEY.ARROW_UP);\nnormalizedKeys.add(KEY.ARROW_RIGHT);\nnormalizedKeys.add(KEY.ARROW_DOWN);\nnormalizedKeys.add(KEY.DELETE);\nnormalizedKeys.add(KEY.ESCAPE);\nnormalizedKeys.add(KEY.TAB);\n\nconst KEY_CODE = {\n BACKSPACE: 8,\n ENTER: 13,\n SPACEBAR: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n END: 35,\n HOME: 36,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n DELETE: 46,\n ESCAPE: 27,\n TAB: 9,\n};\n\nconst mappedKeyCodes = new Map<number, string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nmappedKeyCodes.set(KEY_CODE.BACKSPACE, KEY.BACKSPACE);\nmappedKeyCodes.set(KEY_CODE.ENTER, KEY.ENTER);\nmappedKeyCodes.set(KEY_CODE.SPACEBAR, KEY.SPACEBAR);\nmappedKeyCodes.set(KEY_CODE.PAGE_UP, KEY.PAGE_UP);\nmappedKeyCodes.set(KEY_CODE.PAGE_DOWN, KEY.PAGE_DOWN);\nmappedKeyCodes.set(KEY_CODE.END, KEY.END);\nmappedKeyCodes.set(KEY_CODE.HOME, KEY.HOME);\nmappedKeyCodes.set(KEY_CODE.ARROW_LEFT, KEY.ARROW_LEFT);\nmappedKeyCodes.set(KEY_CODE.ARROW_UP, KEY.ARROW_UP);\nmappedKeyCodes.set(KEY_CODE.ARROW_RIGHT, KEY.ARROW_RIGHT);\nmappedKeyCodes.set(KEY_CODE.ARROW_DOWN, KEY.ARROW_DOWN);\nmappedKeyCodes.set(KEY_CODE.DELETE, KEY.DELETE);\nmappedKeyCodes.set(KEY_CODE.ESCAPE, KEY.ESCAPE);\nmappedKeyCodes.set(KEY_CODE.TAB, KEY.TAB);\n\nconst navigationKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this\n// by hand.\nnavigationKeys.add(KEY.PAGE_UP);\nnavigationKeys.add(KEY.PAGE_DOWN);\nnavigationKeys.add(KEY.END);\nnavigationKeys.add(KEY.HOME);\nnavigationKeys.add(KEY.ARROW_LEFT);\nnavigationKeys.add(KEY.ARROW_UP);\nnavigationKeys.add(KEY.ARROW_RIGHT);\nnavigationKeys.add(KEY.ARROW_DOWN);\n\n/**\n * normalizeKey returns the normalized string for a navigational action.\n */\nexport function normalizeKey(evt: KeyboardEvent): string {\n const {key} = evt;\n // If the event already has a normalized key, return it\n if (normalizedKeys.has(key)) {\n return key;\n }\n\n // tslint:disable-next-line:deprecation\n const mappedKey = mappedKeyCodes.get(evt.keyCode);\n if (mappedKey) {\n return mappedKey;\n }\n return KEY.UNKNOWN;\n}\n\n/**\n * isNavigationEvent returns whether the event is a navigation event\n */\nexport function isNavigationEvent(evt: KeyboardEvent): boolean {\n return navigationKeys.has(normalizeKey(evt));\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/**\n * @fileoverview A \"ponyfill\" is a polyfill that doesn't modify the global\n * prototype chain. This makes ponyfills safer than traditional polyfills,\n * 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\n/** Element.matches with support for webkit and IE. */\nexport function matches(element: Element, selector: string): boolean {\n const nativeMatches = element.matches || element.webkitMatchesSelector ||\n (element as any).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 {estimateScrollWidth} from '@material/dom/ponyfill';\n\nimport {MDCFloatingLabelAdapter} from './adapter';\nimport {MDCFloatingLabelFoundation} from './foundation';\n\n/** MDC Floating Label Factory */\nexport type MDCFloatingLabelFactory =\n (el: HTMLElement, foundation?: MDCFloatingLabelFoundation) =>\n MDCFloatingLabel;\n\n/** MDC Floating Label */\nexport class MDCFloatingLabel extends MDCComponent<MDCFloatingLabelFoundation> {\n static override attachTo(root: HTMLElement): 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;\n * 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;\n * otherwise, docks it by removing the class.\n */\n float(shouldFloat: boolean) {\n this.foundation.float(shouldFloat);\n }\n\n /**\n * Styles the label as required.\n * @param isRequired If true, adds an asterisk to the label, indicating that\n * it is required.\n */\n setRequired(isRequired: boolean) {\n this.foundation.setRequired(isRequired);\n }\n\n getWidth(): number {\n return this.foundation.getWidth();\n }\n\n override 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 order as the adapter interface.\n const adapter: MDCFloatingLabelAdapter = {\n addClass: (className) => {\n this.root.classList.add(className);\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n hasClass: (className) => this.root.classList.contains(className),\n getWidth: () => estimateScrollWidth(this.root),\n registerInteractionHandler: (evtType, handler) => {\n this.listen(evtType, handler);\n },\n deregisterInteractionHandler: (evtType, handler) => {\n this.unlisten(evtType, handler);\n },\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_REQUIRED: 'mdc-floating-label--required',\n LABEL_HIDE_REQUIRED_MARKER: 'mdc-floating-label--hide-required-marker',\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';\n\nimport {MDCFloatingLabelAdapter} from './adapter';\nimport {cssClasses} from './constants';\n\n/** MDC Floating Label Foundation */\nexport class MDCFloatingLabelFoundation extends\n MDCFoundation<MDCFloatingLabelAdapter> {\n static override get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCFloatingLabelAdapter} for typing information on parameters\n * and return types.\n */\n static override 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 hasClass: () => false,\n getWidth: () => 0,\n registerInteractionHandler: () => undefined,\n deregisterInteractionHandler: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly shakeAnimationEndHandler:\n SpecificEventListener<'animationend'>;\n\n constructor(adapter?: Partial<MDCFloatingLabelAdapter>) {\n super({...MDCFloatingLabelFoundation.defaultAdapter, ...adapter});\n\n this.shakeAnimationEndHandler = () => {\n this.handleShakeAnimationEnd();\n };\n }\n\n override init() {\n this.adapter.registerInteractionHandler(\n 'animationend', this.shakeAnimationEndHandler);\n }\n\n override destroy() {\n this.adapter.deregisterInteractionHandler(\n '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\n * 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\n * float and shake classes to dock the label.\n */\n float(shouldFloat: boolean) {\n const {LABEL_FLOAT_ABOVE, LABEL_SHAKE} =\n 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 /**\n * Styles the label as required.\n * @param isRequired If true, adds an asterisk to the label, indicating that\n * it is required.\n */\n setRequired(isRequired: boolean) {\n const {LABEL_REQUIRED} = MDCFloatingLabelFoundation.cssClasses;\n if (isRequired) {\n this.adapter.addClass(LABEL_REQUIRED);\n } else {\n this.adapter.removeClass(LABEL_REQUIRED);\n }\n }\n\n setHideRequiredMarker(hideRequiredMarker: boolean) {\n const {LABEL_HIDE_REQUIRED_MARKER} = MDCFloatingLabelFoundation.cssClasses;\n if (hideRequiredMarker) {\n this.adapter.addClass(LABEL_HIDE_REQUIRED_MARKER);\n } else {\n this.adapter.removeClass(LABEL_HIDE_REQUIRED_MARKER);\n }\n }\n\n getHideRequiredMarker(): boolean {\n const {LABEL_HIDE_REQUIRED_MARKER} = MDCFloatingLabelFoundation.cssClasses;\n return this.adapter.hasClass(LABEL_HIDE_REQUIRED_MARKER);\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 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 {MDCLineRippleAdapter} from './adapter';\nimport {MDCLineRippleFoundation} from './foundation';\n\n/** MDC Line Ripple Factory */\nexport type MDCLineRippleFactory =\n (el: HTMLElement, foundation?: MDCLineRippleFoundation) => MDCLineRipple;\n\n/** MDC Line Ripple */\nexport class MDCLineRipple extends MDCComponent<MDCLineRippleFoundation> {\n static override attachTo(root: HTMLElement): 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 override 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 order as the adapter interface.\n const adapter: MDCLineRippleAdapter = {\n addClass: (className) => {\n this.root.classList.add(className);\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n hasClass: (className) => this.root.classList.contains(className),\n setStyle: (propertyName, value) => {\n this.root.style.setProperty(propertyName, value);\n },\n registerEventHandler: (evtType, handler) => {\n this.listen(evtType, handler);\n },\n deregisterEventHandler: (evtType, handler) => {\n this.unlisten(evtType, handler);\n },\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';\n\nimport {MDCLineRippleAdapter} from './adapter';\nimport {cssClasses} from './constants';\n\n/** MDC Line Ripple Foundation */\nexport class MDCLineRippleFoundation extends\n MDCFoundation<MDCLineRippleAdapter> {\n static override get cssClasses() {\n return cssClasses;\n }\n\n /**\n * See {@link MDCLineRippleAdapter} for typing information on parameters and\n * return types.\n */\n static override 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) => {\n this.handleTransitionEnd(evt);\n };\n }\n\n override init() {\n this.adapter.registerEventHandler(\n 'transitionend', this.transitionEndHandler);\n }\n\n override destroy() {\n this.adapter.deregisterEventHandler(\n '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 =\n 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 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';\n\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, deprecatedClassNameMap, evolutionAttribute, evolutionClassNameMap, numbers, strings} from './constants';\nimport {MDCListFoundation} from './foundation';\nimport {MDCListActionEventDetail, MDCListIndex, MDCListSelectionChangeDetail} from './types';\n\n/** MDC List Factory */\nexport type MDCListFactory =\n (el: HTMLElement, foundation?: MDCListFoundation) => MDCList;\n\n/** MDC List */\nexport class MDCList extends MDCComponent<MDCListFoundation> {\n set vertical(value: boolean) {\n this.foundation.setVerticalOrientation(value);\n }\n\n get listElements() {\n return Array.from(this.root.querySelectorAll<HTMLElement>(\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}`));\n }\n\n set wrapFocus(value: boolean) {\n this.foundation.setWrapFocus(value);\n }\n\n /**\n * @return Whether typeahead is currently matching a user-specified prefix.\n */\n get typeaheadInProgress(): boolean {\n return this.foundation.isTypeaheadInProgress();\n }\n\n /**\n * Sets whether typeahead functionality is enabled on the list.\n * @param hasTypeahead Whether typeahead is enabled.\n */\n set hasTypeahead(hasTypeahead: boolean) {\n this.foundation.setHasTypeahead(hasTypeahead);\n }\n\n set singleSelection(isSingleSelectionList: boolean) {\n this.foundation.setSingleSelection(isSingleSelectionList);\n }\n\n set disabledItemsFocusable(areDisabledItemsFocusable: boolean) {\n this.foundation.setDisabledItemsFocusable(areDisabledItemsFocusable);\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 override attachTo(root: HTMLElement) {\n return new MDCList(root);\n }\n\n // The follow are assigned in initialSyncWithDOM().\n private handleKeydown!: SpecificEventListener<'keydown'>;\n private handleClick!: SpecificEventListener<'click'>;\n private focusInEventListener!: SpecificEventListener<'focus'>;\n private focusOutEventListener!: SpecificEventListener<'focus'>;\n\n // This mapping provides a layer of indirection from legacy classes to\n // evolution classes, since there are some inconsistencies between the\n // two.\n // TODO(b/176814973): remove this map when evolution is launched.\n private classNameMap!: {[className: string]: string};\n private isEvolutionEnabled!: boolean;\n private isInteractive!: boolean;\n\n override initialSyncWithDOM() {\n this.isEvolutionEnabled = evolutionAttribute in this.root.dataset;\n\n if (this.isEvolutionEnabled) {\n this.classNameMap = evolutionClassNameMap;\n } else if (matches(this.root, strings.DEPRECATED_SELECTOR)) {\n this.classNameMap = deprecatedClassNameMap;\n } else {\n this.classNameMap =\n Object.values(cssClasses)\n .reduce((obj: {[className: string]: string}, className) => {\n obj[className] = className;\n return obj;\n }, {});\n }\n\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 this.ensureFocusable();\n }\n\n override 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 const itemSelector =\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}:not([tabindex])`;\n const childSelector = strings.FOCUSABLE_CHILD_ELEMENTS;\n\n // List items need to have at least tabindex=-1 to be focusable.\n const itemEls = this.root.querySelectorAll<HTMLElement>(itemSelector);\n if (itemEls.length) {\n Array.prototype.forEach.call(itemEls, (el: Element) => {\n el.setAttribute('tabindex', '-1');\n });\n }\n\n // Child button/a elements are not tabbable until the list item is focused.\n const focusableChildEls =\n this.root.querySelectorAll<HTMLElement>(childSelector);\n if (focusableChildEls.length) {\n Array.prototype.forEach.call(focusableChildEls, (el: Element) => {\n el.setAttribute('tabindex', '-1');\n });\n }\n\n if (this.isEvolutionEnabled) {\n this.foundation.setUseSelectedAttribute(true);\n }\n this.foundation.layout();\n }\n\n /**\n * Extracts the primary text from a list item.\n * @param item The list item element.\n * @return The primary text in the element.\n */\n getPrimaryText(item: Element): string {\n const primaryText = item.querySelector<HTMLElement>(\n `.${this.classNameMap[cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS]}`);\n if (this.isEvolutionEnabled || primaryText) {\n return primaryText?.textContent ?? '';\n }\n\n const singleLineText = item.querySelector<HTMLElement>(\n `.${this.classNameMap[cssClasses.LIST_ITEM_TEXT_CLASS]}`);\n return (singleLineText && singleLineText.textContent) || '';\n }\n\n /**\n * Initialize selectedIndex value based on pre-selected list items.\n */\n initializeListType() {\n this.isInteractive =\n matches(this.root, strings.ARIA_INTERACTIVE_ROLES_SELECTOR);\n\n if (this.isEvolutionEnabled && this.isInteractive) {\n const selection = Array.from(\n this.root.querySelectorAll<HTMLElement>(\n strings.SELECTED_ITEM_SELECTOR),\n (listItem) => this.listElements.indexOf(listItem));\n\n if (matches(this.root, strings.ARIA_MULTI_SELECTABLE_SELECTOR)) {\n this.selectedIndex = selection;\n } else if (selection.length > 0) {\n this.selectedIndex = selection[0];\n }\n return;\n }\n\n const checkboxListItems = this.root.querySelectorAll<HTMLElement>(\n strings.ARIA_ROLE_CHECKBOX_SELECTOR);\n const radioSelectedListItem = this.root.querySelector<HTMLElement>(\n strings.ARIA_CHECKED_RADIO_SELECTOR);\n\n if (checkboxListItems.length) {\n const preselectedItems = this.root.querySelectorAll<HTMLElement>(\n strings.ARIA_CHECKED_CHECKBOX_SELECTOR);\n this.selectedIndex = Array.from(\n preselectedItems, (listItem) => this.listElements.indexOf(listItem));\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 /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Defaults to\n * the currently focused index.\n * @return The index of the matched item.\n */\n typeaheadMatchItem(nextChar: string, startingIndex?: number): number {\n return this.foundation.typeaheadMatchItem(\n nextChar, startingIndex, /** skipFocus */ true);\n }\n\n override 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 const adapter: MDCListAdapter = {\n addClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.add(this.classNameMap[className]);\n }\n },\n focusItemAtIndex: (index) => {\n this.listElements[index]?.focus();\n },\n getAttributeForElementIndex: (index, attr) =>\n this.listElements[index].getAttribute(attr),\n getFocusedElementIndex: () =>\n this.listElements.indexOf(document.activeElement as HTMLElement),\n getListItemCount: () => this.listElements.length,\n getPrimaryTextAtIndex: (index) =>\n this.getPrimaryText(this.listElements[index]),\n hasCheckboxAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector<HTMLElement>(strings.CHECKBOX_SELECTOR);\n },\n hasRadioAtIndex: (index) => {\n const listItem = this.listElements[index];\n return !!listItem.querySelector<HTMLElement>(strings.RADIO_SELECTOR);\n },\n isCheckboxCheckedAtIndex: (index) => {\n const listItem = this.listElements[index];\n const toggleEl =\n listItem.querySelector<HTMLInputElement>(strings.CHECKBOX_SELECTOR);\n return toggleEl!.checked;\n },\n isFocusInsideList: () => {\n return this.root !== document.activeElement &&\n this.root.contains(document.activeElement);\n },\n isRootFocused: () => document.activeElement === this.root,\n listItemAtIndexHasClass: (index, className) =>\n this.listElements[index].classList.contains(\n this.classNameMap[className]),\n notifyAction: (index) => {\n this.emit<MDCListActionEventDetail>(\n strings.ACTION_EVENT, {index}, /** shouldBubble */ true);\n },\n notifySelectionChange: (changedIndices: number[]) => {\n this.emit<MDCListSelectionChangeDetail>(\n strings.SELECTION_CHANGE_EVENT, {changedIndices},\n /** shouldBubble */ true);\n },\n removeClassForElementIndex: (index, className) => {\n const element = this.listElements[index];\n if (element) {\n element.classList.remove(this.classNameMap[className]);\n }\n },\n setAttributeForElementIndex: (index, attr, value) => {\n const element = this.listElements[index];\n if (element) {\n this.safeSetAttribute(element, attr, value);\n }\n },\n setCheckedCheckboxOrRadioAtIndex: (index, isChecked) => {\n const listItem = this.listElements[index];\n const toggleEl = listItem.querySelector<HTMLInputElement>(\n 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 selector = strings.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;\n Array.prototype.forEach.call(\n element.querySelectorAll<HTMLElement>(selector),\n (el: HTMLElement) => {\n el.tabIndex = Number(tabIndexValue);\n });\n },\n };\n return new MDCListFoundation(adapter);\n }\n\n /**\n * Ensures that at least one item is focusable if the list is interactive and\n * doesn't specify a suitable tabindex.\n */\n private ensureFocusable() {\n if (this.isEvolutionEnabled && this.isInteractive) {\n if (!this.root.querySelector(`.${\n this.classNameMap[cssClasses.LIST_ITEM_CLASS]}[tabindex=\"0\"]`)) {\n const index = this.initialFocusIndex();\n if (index !== -1) {\n this.listElements[index].tabIndex = 0;\n }\n }\n }\n }\n\n private initialFocusIndex(): number {\n if (this.selectedIndex instanceof Array && this.selectedIndex.length > 0) {\n return this.selectedIndex[0];\n }\n if (typeof this.selectedIndex === 'number' &&\n this.selectedIndex !== numbers.UNSET_INDEX) {\n return this.selectedIndex;\n }\n const el = this.root.querySelector<HTMLElement>(\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}:not(.${\n this.classNameMap[cssClasses.LIST_ITEM_DISABLED_CLASS]})`);\n if (el === null) {\n return -1;\n }\n return this.getListItemIndex(el);\n }\n\n /**\n * Used to figure out which list item this event is targeting. Or returns -1\n * if there is no list item\n */\n private getListItemIndex(el: Element) {\n const nearestParent = closest(\n el,\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}, .${\n this.classNameMap[cssClasses.ROOT]}`);\n\n // Get the index of the element if it is a list item.\n if (nearestParent &&\n matches(\n nearestParent,\n `.${this.classNameMap[cssClasses.LIST_ITEM_CLASS]}`)) {\n return this.listElements.indexOf(nearestParent as HTMLElement);\n }\n\n return -1;\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to\n * the foundation.\n */\n private handleFocusInEvent(evt: FocusEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n this.foundation.handleFocusIn(index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to\n * the foundation.\n */\n private handleFocusOutEvent(evt: FocusEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n this.foundation.handleFocusOut(index);\n }\n\n /**\n * Used to figure out which element was focused when keydown event occurred\n * before sending the event to the foundation.\n */\n private handleKeydownEvent(evt: KeyboardEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n const target = evt.target as Element;\n this.foundation.handleKeydown(\n evt,\n target.classList.contains(\n this.classNameMap[cssClasses.LIST_ITEM_CLASS]),\n index);\n }\n\n /**\n * Used to figure out which element was clicked before sending the event to\n * the foundation.\n */\n private handleClickEvent(evt: MouseEvent) {\n const index = this.getListItemIndex(evt.target as Element);\n const target = evt.target as Element;\n this.foundation.handleClick(\n index, matches(target, strings.CHECKBOX_RADIO_SELECTOR), evt);\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 LIST_ITEM_TEXT_CLASS: 'mdc-list-item__text',\n LIST_ITEM_PRIMARY_TEXT_CLASS: 'mdc-list-item__primary-text',\n ROOT: 'mdc-list',\n};\n\nconst evolutionClassNameMap = {\n [`${cssClasses.LIST_ITEM_ACTIVATED_CLASS}`]: 'mdc-list-item--activated',\n [`${cssClasses.LIST_ITEM_CLASS}`]: 'mdc-list-item',\n [`${cssClasses.LIST_ITEM_DISABLED_CLASS}`]: 'mdc-list-item--disabled',\n [`${cssClasses.LIST_ITEM_SELECTED_CLASS}`]: 'mdc-list-item--selected',\n [`${cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS}`]: 'mdc-list-item__primary-text',\n [`${cssClasses.ROOT}`]: 'mdc-list',\n};\n\nconst deprecatedClassNameMap = {\n [`${cssClasses.LIST_ITEM_ACTIVATED_CLASS}`]:\n 'mdc-deprecated-list-item--activated',\n [`${cssClasses.LIST_ITEM_CLASS}`]: 'mdc-deprecated-list-item',\n [`${cssClasses.LIST_ITEM_DISABLED_CLASS}`]:\n 'mdc-deprecated-list-item--disabled',\n [`${cssClasses.LIST_ITEM_SELECTED_CLASS}`]:\n 'mdc-deprecated-list-item--selected',\n [`${cssClasses.LIST_ITEM_TEXT_CLASS}`]: 'mdc-deprecated-list-item__text',\n [`${cssClasses.LIST_ITEM_PRIMARY_TEXT_CLASS}`]:\n 'mdc-deprecated-list-item__primary-text',\n [`${cssClasses.ROOT}`]: 'mdc-deprecated-list',\n};\n\nconst strings = {\n ACTION_EVENT: 'MDCList:action',\n SELECTION_CHANGE_EVENT: 'MDCList:selectionChange',\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 ARIA_INTERACTIVE_ROLES_SELECTOR: '[role=\"listbox\"], [role=\"menu\"]',\n ARIA_MULTI_SELECTABLE_SELECTOR: '[aria-multiselectable=\"true\"]',\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 deprecatedClassNameMap[cssClasses.LIST_ITEM_CLASS]} button:not(:disabled),\n .${deprecatedClassNameMap[cssClasses.LIST_ITEM_CLASS]} a\n `,\n DEPRECATED_SELECTOR: '.mdc-deprecated-list',\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 deprecatedClassNameMap[cssClasses.LIST_ITEM_CLASS]} button:not(:disabled),\n .${deprecatedClassNameMap[cssClasses.LIST_ITEM_CLASS]} a,\n .${\n deprecatedClassNameMap\n [cssClasses.LIST_ITEM_CLASS]} input[type=\"radio\"]:not(:disabled),\n .${\n deprecatedClassNameMap\n [cssClasses.LIST_ITEM_CLASS]} input[type=\"checkbox\"]:not(:disabled)\n `,\n RADIO_SELECTOR: 'input[type=\"radio\"]',\n SELECTED_ITEM_SELECTOR: '[aria-selected=\"true\"], [aria-current=\"true\"]',\n};\n\nconst numbers = {\n UNSET_INDEX: -1,\n TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS: 300\n};\n\nconst evolutionAttribute = 'evolution';\n\nexport {\n strings,\n cssClasses,\n numbers,\n deprecatedClassNameMap,\n evolutionAttribute,\n evolutionClassNameMap\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 ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];\n\n/**\n * Ensures that preventDefault is only called if the containing element\n * doesn't consume the event, and it will cause an unintended scroll.\n *\n * @param evt keyboard event to be prevented.\n */\nexport const preventDefaultEvent = (evt: KeyboardEvent) => {\n const target = evt.target as Element;\n if (!target) {\n return;\n }\n const tagName = `${target.tagName}`.toLowerCase();\n if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {\n evt.preventDefault();\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\nimport {MDCFoundation} from '@material/base/foundation';\nimport {normalizeKey} from '@material/dom/keyboard';\n\nimport {MDCListAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {preventDefaultEvent} from './events';\nimport * as typeahead from './typeahead';\nimport {MDCListIndex, MDCListTextAndIndex} from './types';\n\nfunction isNumberArray(selectedIndex: MDCListIndex): selectedIndex is number[] {\n return selectedIndex instanceof Array;\n}\n\n/**\n * Options for configuring how to update a selectable list item.\n */\ninterface SelectionUpdateOptions {\n /** Whether the update was triggered by a user interaction. */\n isUserInteraction?: boolean;\n /**\n * Whether the UI should be updated regardless of whether the\n * selection would be a noop according to the foundation state.\n * https://github.com/material-components/material-components-web/commit/5d060518804437aa1ae3152562f1bb78b1af4aa6.\n */\n forceUpdate?: boolean;\n /**\n * Whether disabled items should be omitted from updates. This is most\n * relevant when trying to update all the items in a selection list.\n */\n omitDisabledItems?: boolean;\n}\n\n/** List of modifier keys to consider while handling keyboard events. */\nconst handledModifierKeys = ['Alt', 'Control', 'Meta', 'Shift'] as const;\n\n/** Type representing a modifier key we handle. */\ntype ModifierKey = NonNullable<(typeof handledModifierKeys)[number]>;\n\n/** Checks if the event has the given modifier keys. */\nfunction createModifierChecker(event?: KeyboardEvent|MouseEvent) {\n const eventModifiers = new Set(\n event ? handledModifierKeys.filter(m => event.getModifierState(m)) : []);\n return (modifiers: ModifierKey[]) =>\n modifiers.every(m => eventModifiers.has(m)) &&\n modifiers.length === eventModifiers.size;\n}\n\n/** MDC List Foundation */\nexport class MDCListFoundation extends MDCFoundation<MDCListAdapter> {\n static override get strings() {\n return strings;\n }\n\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get numbers() {\n return numbers;\n }\n\n static override 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 notifySelectionChange: () => {},\n removeClassForElementIndex: () => undefined,\n setAttributeForElementIndex: () => undefined,\n setCheckedCheckboxOrRadioAtIndex: () => undefined,\n setTabIndexForListItemChildren: () => undefined,\n getPrimaryTextAtIndex: () => '',\n };\n }\n\n private wrapFocus = false;\n private isVertical = true;\n private isSingleSelectionList = false;\n private areDisabledItemsFocusable = false;\n private selectedIndex: MDCListIndex = numbers.UNSET_INDEX;\n private focusedItemIndex = numbers.UNSET_INDEX;\n private useActivatedClass = false;\n private useSelectedAttr = false;\n private ariaCurrentAttrValue: string|null = null;\n private isCheckboxList = false;\n private isRadioList = false;\n private lastSelectedIndex: number|null = null;\n\n private hasTypeahead = false;\n // Transiently holds current typeahead prefix from user.\n private readonly typeaheadState = typeahead.initState();\n private sortedIndexByFirstChar = new Map<string, MDCListTextAndIndex[]>();\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 // TODO(b/172274142): consider all items when determining the list's type.\n if (this.adapter.hasCheckboxAtIndex(0)) {\n this.isCheckboxList = true;\n this.selectedIndex = [];\n } else if (this.adapter.hasRadioAtIndex(0)) {\n this.isRadioList = true;\n } else {\n this.maybeInitializeSingleSelection();\n }\n\n if (this.hasTypeahead) {\n this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex();\n }\n }\n\n /** Returns the index of the item that was last focused. */\n getFocusedItemIndex() {\n return this.focusedItemIndex;\n }\n\n /** Toggles focus wrapping with keyboard navigation. */\n setWrapFocus(value: boolean) {\n this.wrapFocus = value;\n }\n\n /**\n * Toggles orientation direction for keyboard navigation (true for vertical,\n * false for horizontal).\n */\n setVerticalOrientation(value: boolean) {\n this.isVertical = value;\n }\n\n /** Toggles single-selection behavior. */\n setSingleSelection(value: boolean) {\n this.isSingleSelectionList = value;\n if (value) {\n this.maybeInitializeSingleSelection();\n this.selectedIndex = this.getSelectedIndexFromDOM();\n }\n }\n\n setDisabledItemsFocusable(value: boolean) {\n this.areDisabledItemsFocusable = value;\n }\n\n /**\n * Automatically determines whether the list is single selection list. If so,\n * initializes the internal state to match the selected item.\n */\n private maybeInitializeSingleSelection() {\n const selectedItemIndex = this.getSelectedIndexFromDOM();\n if (selectedItemIndex === numbers.UNSET_INDEX) return;\n\n const hasActivatedClass = this.adapter.listItemAtIndexHasClass(\n selectedItemIndex, cssClasses.LIST_ITEM_ACTIVATED_CLASS);\n if (hasActivatedClass) {\n this.setUseActivatedClass(true);\n }\n this.isSingleSelectionList = true;\n this.selectedIndex = selectedItemIndex;\n }\n\n /** @return Index of the first selected item based on the DOM state. */\n private getSelectedIndexFromDOM() {\n let selectedIndex = numbers.UNSET_INDEX;\n const listItemsCount = this.adapter.getListItemCount();\n for (let i = 0; i < listItemsCount; i++) {\n const hasSelectedClass = this.adapter.listItemAtIndexHasClass(\n i, cssClasses.LIST_ITEM_SELECTED_CLASS);\n const hasActivatedClass = this.adapter.listItemAtIndexHasClass(\n i, cssClasses.LIST_ITEM_ACTIVATED_CLASS);\n if (!(hasSelectedClass || hasActivatedClass)) {\n continue;\n }\n\n selectedIndex = i;\n break;\n }\n\n return selectedIndex;\n }\n\n /**\n * Sets whether typeahead is enabled on the list.\n * @param hasTypeahead Whether typeahead is enabled.\n */\n setHasTypeahead(hasTypeahead: boolean) {\n this.hasTypeahead = hasTypeahead;\n if (hasTypeahead) {\n this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex();\n }\n }\n\n /**\n * @return Whether typeahead is currently matching a user-specified prefix.\n */\n isTypeaheadInProgress(): boolean {\n return this.hasTypeahead &&\n typeahead.isTypingInProgress(this.typeaheadState);\n }\n\n /** Toggle use of the \"activated\" CSS class. */\n setUseActivatedClass(useActivated: boolean) {\n this.useActivatedClass = useActivated;\n }\n\n /**\n * Toggles use of the selected attribute (true for aria-selected, false for\n * aria-checked).\n */\n setUseSelectedAttribute(useSelected: boolean) {\n this.useSelectedAttr = useSelected;\n }\n\n getSelectedIndex(): MDCListIndex {\n return this.selectedIndex;\n }\n\n setSelectedIndex(index: MDCListIndex, options: SelectionUpdateOptions = {}) {\n if (!this.isIndexValid(index)) {\n return;\n }\n\n if (this.isCheckboxList) {\n this.setCheckboxAtIndex(index as number[], options);\n } else if (this.isRadioList) {\n this.setRadioAtIndex(index as number, options);\n } else {\n this.setSingleSelectionAtIndex(index as number, options);\n }\n }\n\n /**\n * Focus in handler for the list items.\n */\n handleFocusIn(listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.focusedItemIndex = listItemIndex;\n this.adapter.setAttributeForElementIndex(listItemIndex, 'tabindex', '0');\n this.adapter.setTabIndexForListItemChildren(listItemIndex, '0');\n }\n }\n\n /**\n * Focus out handler for the list items.\n */\n handleFocusOut(listItemIndex: number) {\n if (listItemIndex >= 0) {\n this.adapter.setAttributeForElementIndex(listItemIndex, 'tabindex', '-1');\n this.adapter.setTabIndexForListItemChildren(listItemIndex, '-1');\n }\n\n /**\n * Between Focusout & Focusin some browsers do not have focus on any\n * element. Setting a delay to wait till the focus is moved to next element.\n */\n setTimeout(() => {\n if (!this.adapter.isFocusInsideList()) {\n this.setTabindexToFirstSelectedOrFocusedItem();\n }\n }, 0);\n }\n\n private isIndexDisabled(index: number) {\n return this.adapter.listItemAtIndexHasClass(\n index, cssClasses.LIST_ITEM_DISABLED_CLASS);\n }\n\n /**\n * Key handler for the list.\n */\n handleKeydown(\n event: KeyboardEvent, isRootListItem: boolean, listItemIndex: number) {\n const isArrowLeft = normalizeKey(event) === 'ArrowLeft';\n const isArrowUp = normalizeKey(event) === 'ArrowUp';\n const isArrowRight = normalizeKey(event) === 'ArrowRight';\n const isArrowDown = normalizeKey(event) === 'ArrowDown';\n const isHome = normalizeKey(event) === 'Home';\n const isEnd = normalizeKey(event) === 'End';\n const isEnter = normalizeKey(event) === 'Enter';\n const isSpace = normalizeKey(event) === 'Spacebar';\n\n // The keys for forward and back differ based on list orientation.\n const isForward =\n (this.isVertical && isArrowDown) || (!this.isVertical && isArrowRight);\n const isBack =\n (this.isVertical && isArrowUp) || (!this.isVertical && isArrowLeft);\n\n // Have to check both upper and lower case, because having caps lock on\n // affects the value.\n const isLetterA = event.key === 'A' || event.key === 'a';\n\n const eventHasModifiers = createModifierChecker(event);\n\n if (this.adapter.isRootFocused()) {\n if ((isBack || isEnd) && eventHasModifiers([])) {\n event.preventDefault();\n this.focusLastElement();\n } else if ((isForward || isHome) && eventHasModifiers([])) {\n event.preventDefault();\n this.focusFirstElement();\n } else if (\n isBack && eventHasModifiers(['Shift']) && this.isCheckboxList) {\n event.preventDefault();\n const focusedIndex = this.focusLastElement();\n if (focusedIndex !== -1) {\n this.setSelectedIndexOnAction(focusedIndex, false);\n }\n } else if (\n isForward && eventHasModifiers(['Shift']) && this.isCheckboxList) {\n event.preventDefault();\n const focusedIndex = this.focusFirstElement();\n if (focusedIndex !== -1) {\n this.setSelectedIndexOnAction(focusedIndex, false);\n }\n }\n\n if (this.hasTypeahead) {\n const handleKeydownOpts: typeahead.HandleKeydownOpts = {\n event,\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index);\n },\n focusedItemIndex: -1,\n isTargetListItem: isRootListItem,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n isItemAtIndexDisabled: (index) => this.isIndexDisabled(index),\n };\n\n typeahead.handleKeydown(handleKeydownOpts, this.typeaheadState);\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 if (isForward && eventHasModifiers([])) {\n preventDefaultEvent(event);\n this.focusNextElement(currentIndex);\n } else if (isBack && eventHasModifiers([])) {\n preventDefaultEvent(event);\n this.focusPrevElement(currentIndex);\n } else if (\n isForward && eventHasModifiers(['Shift']) && this.isCheckboxList) {\n preventDefaultEvent(event);\n const focusedIndex = this.focusNextElement(currentIndex);\n if (focusedIndex !== -1) {\n this.setSelectedIndexOnAction(focusedIndex, false);\n }\n } else if (isBack && eventHasModifiers(['Shift']) && this.isCheckboxList) {\n preventDefaultEvent(event);\n const focusedIndex = this.focusPrevElement(currentIndex);\n if (focusedIndex !== -1) {\n this.setSelectedIndexOnAction(focusedIndex, false);\n }\n } else if (isHome && eventHasModifiers([])) {\n preventDefaultEvent(event);\n this.focusFirstElement();\n } else if (isEnd && eventHasModifiers([])) {\n preventDefaultEvent(event);\n this.focusLastElement();\n } else if (\n isHome && eventHasModifiers(['Control', 'Shift']) &&\n this.isCheckboxList) {\n preventDefaultEvent(event);\n if (this.isIndexDisabled(currentIndex)) {\n return;\n }\n this.focusFirstElement();\n this.toggleCheckboxRange(0, currentIndex, currentIndex);\n } else if (\n isEnd && eventHasModifiers(['Control', 'Shift']) &&\n this.isCheckboxList) {\n preventDefaultEvent(event);\n if (this.isIndexDisabled(currentIndex)) {\n return;\n }\n this.focusLastElement();\n this.toggleCheckboxRange(\n currentIndex, this.adapter.getListItemCount() - 1, currentIndex);\n } else if (\n isLetterA && eventHasModifiers(['Control']) && this.isCheckboxList) {\n event.preventDefault();\n this.checkboxListToggleAll(\n this.selectedIndex === numbers.UNSET_INDEX ?\n [] :\n this.selectedIndex as number[],\n true);\n } else if (\n (isEnter || isSpace) &&\n (eventHasModifiers([]) || eventHasModifiers(['Alt']))) {\n if (isRootListItem) {\n // Return early if enter key is pressed on anchor element which triggers\n // synthetic MouseEvent event.\n const target = event.target as Element | null;\n if (target && target.tagName === 'A' && isEnter) {\n return;\n }\n preventDefaultEvent(event);\n\n if (this.isIndexDisabled(currentIndex)) {\n return;\n }\n\n if (!this.isTypeaheadInProgress()) {\n if (this.isSelectableList()) {\n this.setSelectedIndexOnAction(currentIndex, false);\n }\n this.adapter.notifyAction(currentIndex);\n }\n }\n } else if (\n (isEnter || isSpace) && eventHasModifiers(['Shift']) &&\n this.isCheckboxList) {\n // Return early if enter key is pressed on anchor element which triggers\n // synthetic MouseEvent event.\n const target = event.target as Element | null;\n if (target && target.tagName === 'A' && isEnter) {\n return;\n }\n preventDefaultEvent(event);\n\n if (this.isIndexDisabled(currentIndex)) {\n return;\n }\n\n if (!this.isTypeaheadInProgress()) {\n this.toggleCheckboxRange(\n this.lastSelectedIndex ?? currentIndex, currentIndex, currentIndex);\n this.adapter.notifyAction(currentIndex);\n }\n }\n\n if (this.hasTypeahead) {\n const handleKeydownOpts: typeahead.HandleKeydownOpts = {\n event,\n focusItemAtIndex: (index) => {this.focusItemAtIndex(index)},\n focusedItemIndex: this.focusedItemIndex,\n isTargetListItem: isRootListItem,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n isItemAtIndexDisabled: (index) => this.isIndexDisabled(index),\n };\n\n typeahead.handleKeydown(handleKeydownOpts, this.typeaheadState);\n }\n }\n\n /**\n * Click handler for the list.\n *\n * @param index Index for the item that has been clicked.\n * @param isCheckboxAlreadyUpdatedInAdapter Whether the checkbox for\n * the list item has already been updated in the adapter. This attribute\n * should be set to `true` when e.g. the click event directly landed on\n * the underlying native checkbox element which would cause the checked\n * state to be already toggled within `adapter.isCheckboxCheckedAtIndex`.\n */\n handleClick(\n index: number, isCheckboxAlreadyUpdatedInAdapter: boolean,\n event?: MouseEvent) {\n const eventHasModifiers = createModifierChecker(event);\n\n if (index === numbers.UNSET_INDEX) {\n return;\n }\n\n if (this.isIndexDisabled(index)) {\n return;\n }\n\n if (eventHasModifiers([])) {\n if (this.isSelectableList()) {\n this.setSelectedIndexOnAction(index, isCheckboxAlreadyUpdatedInAdapter);\n }\n this.adapter.notifyAction(index);\n } else if (this.isCheckboxList && eventHasModifiers(['Shift'])) {\n this.toggleCheckboxRange(this.lastSelectedIndex ?? index, index, index);\n this.adapter.notifyAction(index);\n }\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;\n let firstChecked = null;\n\n do {\n nextIndex++;\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 if (nextIndex === firstChecked) {\n return -1;\n }\n firstChecked = firstChecked ?? nextIndex;\n } while (!this.areDisabledItemsFocusable &&\n this.isIndexDisabled(nextIndex));\n\n this.focusItemAtIndex(nextIndex);\n return nextIndex;\n }\n\n /**\n * Focuses the previous element on the list.\n */\n focusPrevElement(index: number) {\n const count = this.adapter.getListItemCount();\n let prevIndex = index;\n let firstChecked = null;\n\n do {\n prevIndex--;\n if (prevIndex < 0) {\n if (this.wrapFocus) {\n prevIndex = count - 1;\n } else {\n // Return early because first item is already focused.\n return index;\n }\n }\n if (prevIndex === firstChecked) {\n return -1;\n }\n firstChecked = firstChecked ?? prevIndex;\n } while (!this.areDisabledItemsFocusable &&\n this.isIndexDisabled(prevIndex));\n\n this.focusItemAtIndex(prevIndex);\n return prevIndex;\n }\n\n focusFirstElement() {\n // Pass -1 to `focusNextElement`, since it will incremement to 0 and focus\n // the first element.\n return this.focusNextElement(-1);\n }\n\n focusLastElement() {\n // Pass the length of the list to `focusNextElement` since it will decrement\n // to length - 1 and focus the last element.\n return this.focusPrevElement(this.adapter.getListItemCount());\n }\n\n focusInitialElement() {\n const initialIndex = this.getFirstSelectedOrFocusedItemIndex();\n if (initialIndex !== numbers.UNSET_INDEX) {\n this.focusItemAtIndex(initialIndex);\n }\n return initialIndex;\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, false)) {\n return;\n }\n\n if (isEnabled) {\n this.adapter.removeClassForElementIndex(\n itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.setAttributeForElementIndex(\n itemIndex, strings.ARIA_DISABLED, 'false');\n } else {\n this.adapter.addClassForElementIndex(\n itemIndex, cssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.setAttributeForElementIndex(\n itemIndex, strings.ARIA_DISABLED, 'true');\n }\n }\n\n private setSingleSelectionAtIndex(\n index: number, options: SelectionUpdateOptions = {}) {\n if (this.selectedIndex === index && !options.forceUpdate) {\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(\n this.selectedIndex as number, selectedClassName);\n }\n\n this.setAriaForSingleSelectionAtIndex(index);\n this.setTabindexAtIndex(index);\n if (index !== numbers.UNSET_INDEX) {\n this.adapter.addClassForElementIndex(index, selectedClassName);\n }\n\n this.selectedIndex = index;\n\n // If the selected value has changed through user interaction,\n // we want to notify the selection change to the adapter.\n if (options.isUserInteraction && !options.forceUpdate) {\n this.adapter.notifySelectionChange([index]);\n }\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\n // initialization when it is in unset state.\n if (this.selectedIndex === numbers.UNSET_INDEX &&\n index !== 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 =\n isAriaCurrent ? strings.ARIA_CURRENT : strings.ARIA_SELECTED;\n\n if (this.selectedIndex !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex as number, ariaAttribute, 'false');\n }\n\n if (index !== numbers.UNSET_INDEX) {\n const ariaAttributeValue =\n isAriaCurrent ? this.ariaCurrentAttrValue : 'true';\n this.adapter.setAttributeForElementIndex(\n index, ariaAttribute, ariaAttributeValue as string);\n }\n }\n\n /**\n * Returns the attribute to use for indicating selection status.\n */\n private getSelectionAttribute(): string {\n return this.useSelectedAttr ? strings.ARIA_SELECTED : strings.ARIA_CHECKED;\n }\n\n /**\n * Toggles radio at give index. Radio doesn't change the checked state if it\n * is already checked.\n */\n private setRadioAtIndex(index: number, options: SelectionUpdateOptions = {}) {\n const selectionAttribute = this.getSelectionAttribute();\n this.adapter.setCheckedCheckboxOrRadioAtIndex(index, true);\n\n if (this.selectedIndex === index && !options.forceUpdate) {\n return;\n }\n\n if (this.selectedIndex !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex as number, selectionAttribute, 'false');\n }\n\n this.adapter.setAttributeForElementIndex(index, selectionAttribute, 'true');\n\n this.selectedIndex = index;\n\n // If the selected value has changed through user interaction,\n // we want to notify the selection change to the adapter.\n if (options.isUserInteraction && !options.forceUpdate) {\n this.adapter.notifySelectionChange([index]);\n }\n }\n\n private setCheckboxAtIndex(\n indices: number[], options: SelectionUpdateOptions = {}) {\n const currentIndex = this.selectedIndex;\n // If this update is not triggered by a user interaction, we do not\n // need to know about the currently selected indices and can avoid\n // constructing the `Set` for performance reasons.\n const currentlySelected = options.isUserInteraction ?\n new Set(\n currentIndex === numbers.UNSET_INDEX ? [] :\n currentIndex as number[]) :\n null;\n const selectionAttribute = this.getSelectionAttribute();\n const changedIndices = [];\n\n for (let i = 0; i < this.adapter.getListItemCount(); i++) {\n if (options.omitDisabledItems && this.isIndexDisabled(i)) {\n continue;\n }\n const previousIsChecked = currentlySelected?.has(i);\n const newIsChecked = indices.indexOf(i) >= 0;\n\n // If the selection has changed for this item, we keep track of it\n // so that we can notify the adapter.\n if (newIsChecked !== previousIsChecked) {\n changedIndices.push(i);\n }\n\n this.adapter.setCheckedCheckboxOrRadioAtIndex(i, newIsChecked);\n this.adapter.setAttributeForElementIndex(\n i, selectionAttribute, newIsChecked ? 'true' : 'false');\n }\n\n this.selectedIndex = options.omitDisabledItems ?\n this.resolveSelectedIndices(indices) :\n indices;\n\n // If the selected value has changed through user interaction,\n // we want to notify the selection change to the adapter.\n if (options.isUserInteraction && changedIndices.length) {\n this.adapter.notifySelectionChange(changedIndices);\n }\n }\n\n /**\n * Helper method for ensuring that the list of selected indices remains\n * accurate when calling setCheckboxAtIndex with omitDisabledItems set to\n * true.\n */\n private resolveSelectedIndices(setCheckedItems: number[]): number[] {\n const currentlySelectedItems = this.selectedIndex === numbers.UNSET_INDEX ?\n [] :\n this.selectedIndex as number[];\n\n const currentlySelectedDisabledItems =\n currentlySelectedItems.filter(i => this.isIndexDisabled(i));\n const enabledSetCheckedItems =\n setCheckedItems.filter(i => !this.isIndexDisabled(i));\n\n // Updated selectedIndex should be the enabled setCheckedItems + any missing\n // selected disabled items.\n const updatedSelectedItems = [...new Set(\n [...enabledSetCheckedItems, ...currentlySelectedDisabledItems])];\n return updatedSelectedItems.sort((a, b) => a - b);\n }\n\n /**\n * Toggles the state of all checkboxes in the given range (inclusive) based\n * on the state of the checkbox at the `toggleIndex`. To determine whether\n * to set the given range to checked or unchecked, read the value of the\n * checkbox at the `toggleIndex` and negate it. Then apply that new checked\n * state to all checkboxes in the range.\n * @param fromIndex The start of the range of checkboxes to toggle\n * @param toIndex The end of the range of checkboxes to toggle\n * @param toggleIndex The index that will be used to determine the new state\n * of the given checkbox range.\n */\n private toggleCheckboxRange(\n fromIndex: number, toIndex: number, toggleIndex: number) {\n this.lastSelectedIndex = toggleIndex;\n const currentlySelected = new Set(\n this.selectedIndex === numbers.UNSET_INDEX ?\n [] :\n this.selectedIndex as number[]);\n const newIsChecked = !currentlySelected?.has(toggleIndex);\n\n const [startIndex, endIndex] = [fromIndex, toIndex].sort();\n const selectionAttribute = this.getSelectionAttribute();\n const changedIndices = [];\n\n for (let i = startIndex; i <= endIndex; i++) {\n if (this.isIndexDisabled(i)) {\n continue;\n }\n const previousIsChecked = currentlySelected.has(i);\n\n // If the selection has changed for this item, we keep track of it\n // so that we can notify the adapter.\n if (newIsChecked !== previousIsChecked) {\n changedIndices.push(i);\n this.adapter.setCheckedCheckboxOrRadioAtIndex(i, newIsChecked);\n this.adapter.setAttributeForElementIndex(\n i, selectionAttribute, `${newIsChecked}`);\n if (newIsChecked) {\n currentlySelected.add(i);\n } else {\n currentlySelected.delete(i);\n }\n }\n }\n\n // If the selected value has changed, update and notify the selection\n // change to the adapter.\n if (changedIndices.length) {\n this.selectedIndex = [...currentlySelected];\n this.adapter.notifySelectionChange(changedIndices);\n }\n }\n\n private setTabindexAtIndex(index: number) {\n if (this.focusedItemIndex === numbers.UNSET_INDEX && index !== 0 &&\n index !== numbers.UNSET_INDEX) {\n // If some 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\n // no preselected items.\n this.adapter.setAttributeForElementIndex(0, 'tabindex', '-1');\n } else if (this.focusedItemIndex >= 0 && this.focusedItemIndex !== index) {\n this.adapter.setAttributeForElementIndex(\n this.focusedItemIndex, 'tabindex', '-1');\n }\n\n // Set the previous selection's tabindex to -1. We need this because\n // in selection menus that are not visible, programmatically setting an\n // option will not change focus but will change where tabindex should be\n // 0.\n if (!(this.selectedIndex instanceof Array) &&\n this.selectedIndex !== index &&\n this.focusedItemIndex !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(\n this.selectedIndex, 'tabindex', '-1');\n }\n\n if (index !== numbers.UNSET_INDEX) {\n this.adapter.setAttributeForElementIndex(index, 'tabindex', '0');\n }\n }\n\n /**\n * @return Return true if it is single selectin list, checkbox list or radio\n * list.\n */\n private isSelectableList() {\n return this.isSingleSelectionList || this.isCheckboxList ||\n this.isRadioList;\n }\n\n private setTabindexToFirstSelectedOrFocusedItem() {\n const targetIndex = this.getFirstSelectedOrFocusedItemIndex();\n this.setTabindexAtIndex(targetIndex);\n }\n\n private getFirstSelectedOrFocusedItemIndex(): number {\n const firstFocusableListItem = this.getFirstEnabledItem();\n\n if (this.adapter.getListItemCount() === 0) {\n return numbers.UNSET_INDEX;\n }\n\n // Action lists retain focus on the most recently focused item.\n if (!this.isSelectableList()) {\n return Math.max(this.focusedItemIndex, firstFocusableListItem);\n }\n\n // Single-selection lists focus the selected item.\n if (typeof this.selectedIndex === 'number' &&\n this.selectedIndex !== numbers.UNSET_INDEX) {\n return this.areDisabledItemsFocusable &&\n this.isIndexDisabled(this.selectedIndex) ?\n firstFocusableListItem :\n this.selectedIndex;\n }\n\n // Multiple-selection lists focus the first enabled selected item.\n if (isNumberArray(this.selectedIndex) && this.selectedIndex.length > 0) {\n const sorted = [...this.selectedIndex].sort((a, b) => a - b);\n for (const index of sorted) {\n if (this.isIndexDisabled(index) && !this.areDisabledItemsFocusable) {\n continue;\n } else {\n return index;\n }\n }\n }\n\n // Selection lists without a selection focus the first item.\n return firstFocusableListItem;\n }\n\n\n private getFirstEnabledItem(): number {\n const listSize = this.adapter.getListItemCount();\n let i = 0;\n while (i < listSize) {\n if (!this.isIndexDisabled(i)) {\n break;\n }\n i++;\n }\n return i === listSize ? numbers.UNSET_INDEX : i;\n }\n\n private isIndexValid(index: MDCListIndex, validateListType = true) {\n if (index instanceof Array) {\n if (!this.isCheckboxList && validateListType) {\n throw new Error(\n '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 && validateListType) {\n throw new Error(\n `MDCListFoundation: Expected array of index for checkbox based list but got number: ${\n index}`);\n }\n return this.isIndexInRange(index) ||\n this.isSingleSelectionList && index === numbers.UNSET_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 checkboxes in checkbox lists\n * by default, unless `isCheckboxAlreadyUpdatedInAdapter` is set to `true`.\n *\n * In cases where `isCheckboxAlreadyUpdatedInAdapter` is set to `true`, the\n * UI is just updated to reflect the value returned by the adapter.\n *\n * When calling this, make sure user interaction does not toggle disabled\n * list items.\n */\n private setSelectedIndexOnAction(\n index: number, isCheckboxAlreadyUpdatedInAdapter: boolean) {\n this.lastSelectedIndex = index;\n if (this.isCheckboxList) {\n this.toggleCheckboxAtIndex(index, isCheckboxAlreadyUpdatedInAdapter);\n this.adapter.notifySelectionChange([index]);\n } else {\n this.setSelectedIndex(index, {isUserInteraction: true});\n }\n }\n\n private toggleCheckboxAtIndex(\n index: number, isCheckboxAlreadyUpdatedInAdapter: boolean) {\n const selectionAttribute = this.getSelectionAttribute();\n const adapterIsChecked = this.adapter.isCheckboxCheckedAtIndex(index);\n\n // By default the checked value from the adapter is toggled unless the\n // checked state in the adapter has already been updated beforehand.\n // This can be happen when the underlying native checkbox has already\n // been updated through the native click event.\n let newCheckedValue;\n if (isCheckboxAlreadyUpdatedInAdapter) {\n newCheckedValue = adapterIsChecked;\n } else {\n newCheckedValue = !adapterIsChecked;\n this.adapter.setCheckedCheckboxOrRadioAtIndex(index, newCheckedValue)\n }\n\n this.adapter.setAttributeForElementIndex(\n index, selectionAttribute, newCheckedValue ? 'true' : 'false');\n\n // If none of the checkbox items are selected and selectedIndex is not\n // initialized then provide a default value.\n let selectedIndexes = this.selectedIndex === numbers.UNSET_INDEX ?\n [] :\n (this.selectedIndex as number[]).slice();\n\n if (newCheckedValue) {\n selectedIndexes.push(index);\n } else {\n selectedIndexes = selectedIndexes.filter((i) => i !== index);\n }\n\n this.selectedIndex = selectedIndexes;\n }\n\n private focusItemAtIndex(index: number) {\n this.adapter.focusItemAtIndex(index);\n this.focusedItemIndex = index;\n }\n\n private getEnabledListItemCount(): number {\n const listSize = this.adapter.getListItemCount();\n let adjustedCount = 0;\n for (let i = 0; i < listSize; i++) {\n if (!this.isIndexDisabled(i)) {\n adjustedCount++;\n }\n }\n return adjustedCount;\n }\n\n private checkboxListToggleAll(\n currentlySelectedIndices: number[], isUserInteraction: boolean) {\n const enabledListItemCount = this.getEnabledListItemCount();\n const totalListItemCount = this.adapter.getListItemCount();\n const currentlyEnabledSelectedIndices =\n currentlySelectedIndices.filter(i => !this.isIndexDisabled(i));\n\n // If all items are selected, deselect everything.\n // We check >= rather than === to `enabledListItemCount` since a disabled\n // item could be selected, and we don't take that into consideration when\n // toggling the other checkbox values.\n if (currentlyEnabledSelectedIndices.length >= enabledListItemCount) {\n // Use omitDisabledItems option to ensure disabled selected items are not\n // de-selected.\n this.setCheckboxAtIndex([], {isUserInteraction, omitDisabledItems: true});\n } else {\n // Otherwise select all enabled options.\n const allIndexes: number[] = [];\n for (let i = 0; i < totalListItemCount; i++) {\n if (!this.isIndexDisabled(i) ||\n currentlySelectedIndices.indexOf(i) > -1) {\n allIndexes.push(i);\n }\n }\n // Use omitDisabledItems option to ensure disabled selected items are not\n // de-selected.\n this.setCheckboxAtIndex(\n allIndexes, {isUserInteraction, omitDisabledItems: true});\n }\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Only\n * relevant when starting a new match sequence. To start a new match\n * sequence, clear the buffer using `clearTypeaheadBuffer`, or wait for\n * the buffer to clear after a set interval defined in list foundation.\n * Defaults to the currently focused index.\n * @return The index of the matched item, or -1 if no match.\n */\n typeaheadMatchItem(\n nextChar: string, startingIndex?: number, skipFocus = false) {\n const opts: typeahead.TypeaheadMatchItemOpts = {\n focusItemAtIndex: (index) => {\n this.focusItemAtIndex(index);\n },\n focusedItemIndex: startingIndex ? startingIndex : this.focusedItemIndex,\n nextChar,\n sortedIndexByFirstChar: this.sortedIndexByFirstChar,\n skipFocus,\n isItemAtIndexDisabled: (index) => this.isIndexDisabled(index)\n };\n return typeahead.matchItem(opts, this.typeaheadState);\n }\n\n /**\n * Initializes the MDCListTextAndIndex data structure by indexing the\n * current list items by primary text.\n *\n * @return The primary texts of all the list items sorted by first\n * character.\n */\n private typeaheadInitSortedIndex() {\n return typeahead.initSortedIndex(\n this.adapter.getListItemCount(), this.adapter.getPrimaryTextAtIndex);\n }\n\n /**\n * Clears the typeahead buffer.\n */\n clearTypeaheadBuffer() {\n typeahead.clearBuffer(this.typeaheadState);\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 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\nimport {normalizeKey} from '@material/dom/keyboard';\n\nimport {numbers} from './constants';\nimport {preventDefaultEvent} from './events';\nimport {MDCListTextAndIndex} from './types';\n\n/**\n * State of a typeahead instance.\n */\nexport interface TypeaheadState {\n typeaheadBuffer: string;\n currentFirstChar: string;\n sortedIndexCursor: number;\n bufferClearTimeout: number;\n}\n\n/**\n * Initializes a state object for typeahead. Use the same reference for calls to\n * typeahead functions.\n *\n * @return The current state of the typeahead process. Each state reference\n * represents a typeahead instance as the reference is typically mutated\n * in-place.\n */\nexport function initState(): TypeaheadState {\n const state: TypeaheadState = {\n bufferClearTimeout: 0,\n currentFirstChar: '',\n sortedIndexCursor: 0,\n typeaheadBuffer: '',\n };\n return state;\n}\n\n/**\n * Initializes typeahead state by indexing the current list items by primary\n * text into the sortedIndexByFirstChar data structure.\n *\n * @param listItemCount numer of items in the list\n * @param getPrimaryTextByItemIndex function that returns the primary text at a\n * given index\n *\n * @return Map that maps the first character of the primary text to the full\n * list text and its index\n */\nexport function initSortedIndex(\n listItemCount: number,\n getPrimaryTextByItemIndex: (index: number) =>\n string): Map<string, MDCListTextAndIndex[]> {\n const sortedIndexByFirstChar = new Map<string, MDCListTextAndIndex[]>();\n\n // Aggregate item text to index mapping\n for (let i = 0; i < listItemCount; i++) {\n const primaryText = getPrimaryTextByItemIndex(i).trim();\n if (!primaryText) {\n continue;\n }\n\n const firstChar = primaryText[0].toLowerCase();\n if (!sortedIndexByFirstChar.has(firstChar)) {\n sortedIndexByFirstChar.set(firstChar, []);\n }\n sortedIndexByFirstChar.get(firstChar)!.push(\n {text: primaryText.toLowerCase(), index: i});\n }\n\n // Sort the mapping\n // TODO(b/157162694): Investigate replacing forEach with Map.values()\n sortedIndexByFirstChar.forEach((values) => {\n values.sort((first: MDCListTextAndIndex, second: MDCListTextAndIndex) => {\n return first.index - second.index;\n });\n });\n\n return sortedIndexByFirstChar;\n}\n\n/**\n * Arguments for matchItem\n */\nexport interface TypeaheadMatchItemOpts {\n focusItemAtIndex: (index: number) => void;\n nextChar: string;\n focusedItemIndex: number;\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>;\n skipFocus: boolean;\n isItemAtIndexDisabled: (index: number) => boolean;\n}\n\n/**\n * Given the next desired character from the user, it attempts to find the next\n * list option matching the buffer. Wraps around if at the end of options.\n *\n * @param opts Options and accessors\n * - nextChar - the next character to match against items\n * - sortedIndexByFirstChar - output of `initSortedIndex(...)`\n * - focusedItemIndex - the index of the currently focused item\n * - focusItemAtIndex - function that focuses a list item at given index\n * - skipFocus - whether or not to focus the matched item\n * - isItemAtIndexDisabled - function that determines whether an item at a\n * given index is disabled\n * @param state The typeahead state instance. See `initState`.\n *\n * @return The index of the matched item, or -1 if no match.\n */\nexport function matchItem(\n opts: TypeaheadMatchItemOpts, state: TypeaheadState): number {\n const {\n nextChar,\n focusItemAtIndex,\n sortedIndexByFirstChar,\n focusedItemIndex,\n skipFocus,\n isItemAtIndexDisabled,\n } = opts;\n\n clearTimeout(state.bufferClearTimeout);\n\n state.bufferClearTimeout = setTimeout(() => {\n clearBuffer(state);\n }, numbers.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS);\n\n state.typeaheadBuffer = state.typeaheadBuffer + nextChar;\n\n let index: number;\n if (state.typeaheadBuffer.length === 1) {\n index = matchFirstChar(\n sortedIndexByFirstChar, focusedItemIndex, isItemAtIndexDisabled, state);\n } else {\n index = matchAllChars(sortedIndexByFirstChar, isItemAtIndexDisabled, state);\n }\n\n if (index !== -1 && !skipFocus) {\n focusItemAtIndex(index);\n }\n return index;\n}\n\n/**\n * Matches the user's single input character in the buffer to the\n * next option that begins with such character. Wraps around if at\n * end of options. Returns -1 if no match is found.\n */\nfunction matchFirstChar(\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>,\n focusedItemIndex: number, isItemAtIndexDisabled: (index: number) => boolean,\n state: TypeaheadState): number {\n const firstChar = state.typeaheadBuffer[0];\n const itemsMatchingFirstChar = sortedIndexByFirstChar.get(firstChar);\n if (!itemsMatchingFirstChar) {\n return -1;\n }\n\n // Has the same firstChar been recently matched?\n // Also, did starting index remain the same between key presses?\n // If both hold true, simply increment index.\n if (firstChar === state.currentFirstChar &&\n itemsMatchingFirstChar[state.sortedIndexCursor].index ===\n focusedItemIndex) {\n state.sortedIndexCursor =\n (state.sortedIndexCursor + 1) % itemsMatchingFirstChar.length;\n\n const newIndex = itemsMatchingFirstChar[state.sortedIndexCursor].index;\n if (!isItemAtIndexDisabled(newIndex)) {\n return newIndex;\n }\n }\n\n // If we're here, it means one of the following happened:\n // - either firstChar or startingIndex has changed, invalidating the\n // cursor.\n // - The next item of typeahead is disabled, so we have to look further.\n state.currentFirstChar = firstChar;\n\n let newCursorPosition = -1;\n let cursorPosition;\n // Find the first non-disabled item as a fallback.\n for (cursorPosition = 0; cursorPosition < itemsMatchingFirstChar.length;\n cursorPosition++) {\n if (!isItemAtIndexDisabled(itemsMatchingFirstChar[cursorPosition].index)) {\n newCursorPosition = cursorPosition;\n break;\n }\n }\n\n // Advance cursor to first item matching the firstChar that is positioned\n // after starting item. Cursor is unchanged from fallback if there's no\n // such item.\n for (; cursorPosition < itemsMatchingFirstChar.length; cursorPosition++) {\n if (itemsMatchingFirstChar[cursorPosition].index > focusedItemIndex &&\n !isItemAtIndexDisabled(itemsMatchingFirstChar[cursorPosition].index)) {\n newCursorPosition = cursorPosition;\n break;\n }\n }\n\n if (newCursorPosition !== -1) {\n state.sortedIndexCursor = newCursorPosition;\n return itemsMatchingFirstChar[state.sortedIndexCursor].index;\n }\n\n return -1;\n}\n\n/**\n * Attempts to find the next item that matches all of the typeahead buffer.\n * Wraps around if at end of options. Returns -1 if no match is found.\n */\nfunction matchAllChars(\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>,\n isItemAtIndexDisabled: (index: number) => boolean,\n state: TypeaheadState): number {\n const firstChar = state.typeaheadBuffer[0];\n const itemsMatchingFirstChar = sortedIndexByFirstChar.get(firstChar);\n if (!itemsMatchingFirstChar) {\n return -1;\n }\n\n // Do nothing if text already matches\n const startingItem = itemsMatchingFirstChar[state.sortedIndexCursor];\n if (startingItem.text.lastIndexOf(state.typeaheadBuffer, 0) === 0 &&\n !isItemAtIndexDisabled(startingItem.index)) {\n return startingItem.index;\n }\n\n // Find next item that matches completely; if no match, we'll eventually\n // loop around to same position\n let cursorPosition =\n (state.sortedIndexCursor + 1) % itemsMatchingFirstChar.length;\n let nextCursorPosition = -1;\n while (cursorPosition !== state.sortedIndexCursor) {\n const currentItem = itemsMatchingFirstChar[cursorPosition];\n\n const matches =\n currentItem.text.lastIndexOf(state.typeaheadBuffer, 0) === 0;\n const isEnabled = !isItemAtIndexDisabled(currentItem.index);\n if (matches && isEnabled) {\n nextCursorPosition = cursorPosition;\n break;\n }\n\n cursorPosition = (cursorPosition + 1) % itemsMatchingFirstChar.length;\n }\n\n if (nextCursorPosition !== -1) {\n state.sortedIndexCursor = nextCursorPosition;\n return itemsMatchingFirstChar[state.sortedIndexCursor].index;\n }\n\n return -1;\n}\n\n/**\n * Whether or not the given typeahead instaance state is currently typing.\n *\n * @param state The typeahead state instance. See `initState`.\n */\nexport function isTypingInProgress(state: TypeaheadState) {\n return state.typeaheadBuffer.length > 0;\n}\n\n/**\n * Options for handleKeydown.\n */\nexport interface HandleKeydownOpts {\n event: KeyboardEvent;\n isTargetListItem: boolean;\n focusItemAtIndex: (index: number) => void;\n focusedItemIndex: number;\n sortedIndexByFirstChar: Map<string, MDCListTextAndIndex[]>;\n isItemAtIndexDisabled: (index: number) => boolean;\n}\n\n/**\n * Clears the typeahaed buffer so that it resets item matching to the first\n * character.\n *\n * @param state The typeahead state instance. See `initState`.\n */\nexport function clearBuffer(state: TypeaheadState) {\n state.typeaheadBuffer = '';\n}\n\n/**\n * Given a keydown event, it calculates whether or not to automatically focus a\n * list item depending on what was typed mimicking the typeahead functionality\n * of a standard <select> element that is open.\n *\n * @param opts Options and accessors\n * - event - the KeyboardEvent to handle and parse\n * - sortedIndexByFirstChar - output of `initSortedIndex(...)`\n * - focusedItemIndex - the index of the currently focused item\n * - focusItemAtIndex - function that focuses a list item at given index\n * - isItemAtFocusedIndexDisabled - whether or not the currently focused item\n * is disabled\n * - isTargetListItem - whether or not the event target is a list item\n * @param state The typeahead state instance. See `initState`.\n *\n * @return index of the item matched by the keydown. -1 if not matched.\n */\nexport function handleKeydown(opts: HandleKeydownOpts, state: TypeaheadState) {\n const {\n event,\n isTargetListItem,\n focusedItemIndex,\n focusItemAtIndex,\n sortedIndexByFirstChar,\n isItemAtIndexDisabled,\n } = opts;\n\n const isArrowLeft = normalizeKey(event) === 'ArrowLeft';\n const isArrowUp = normalizeKey(event) === 'ArrowUp';\n const isArrowRight = normalizeKey(event) === 'ArrowRight';\n const isArrowDown = normalizeKey(event) === 'ArrowDown';\n const isHome = normalizeKey(event) === 'Home';\n const isEnd = normalizeKey(event) === 'End';\n const isEnter = normalizeKey(event) === 'Enter';\n const isSpace = normalizeKey(event) === 'Spacebar';\n\n if (event.altKey || event.ctrlKey || event.metaKey || isArrowLeft ||\n isArrowUp || isArrowRight || isArrowDown || isHome || isEnd || isEnter) {\n return -1;\n }\n\n const isCharacterKey = !isSpace && event.key.length === 1;\n\n if (isCharacterKey) {\n preventDefaultEvent(event);\n const matchItemOpts: TypeaheadMatchItemOpts = {\n focusItemAtIndex,\n focusedItemIndex,\n nextChar: event.key.toLowerCase(),\n sortedIndexByFirstChar,\n skipFocus: false,\n isItemAtIndexDisabled,\n };\n return matchItem(matchItemOpts, state);\n }\n\n if (!isSpace) {\n return -1;\n }\n\n if (isTargetListItem) {\n preventDefaultEvent(event);\n }\n\n const typeaheadOnListItem = isTargetListItem && isTypingInProgress(state);\n\n if (typeaheadOnListItem) {\n const matchItemOpts: TypeaheadMatchItemOpts = {\n focusItemAtIndex,\n focusedItemIndex,\n nextChar: ' ',\n sortedIndexByFirstChar,\n skipFocus: false,\n isItemAtIndexDisabled,\n };\n // space participates in typeahead matching if in rapid typing mode\n return matchItem(matchItemOpts, state);\n }\n\n return -1;\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 {getCorrectPropertyName} from '@material/animation/util';\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\n\nimport {MDCMenuSurfaceAdapter} from './adapter';\nimport {Corner, cssClasses, strings} from './constants';\nimport {MDCMenuSurfaceFoundation} from './foundation';\nimport {MDCMenuDistance} from './types';\n\ntype RegisterFunction = () => void;\n\n/** MDC Menu Surface Factory */\nexport type MDCMenuSurfaceFactory =\n (el: HTMLElement, foundation?: MDCMenuSurfaceFoundation) => MDCMenuSurface;\n\n/** MDC Menu Surface */\nexport class MDCMenuSurface extends MDCComponent<MDCMenuSurfaceFoundation> {\n static override attachTo(root: HTMLElement): MDCMenuSurface {\n return new MDCMenuSurface(root);\n }\n\n anchorElement!: Element|null; // assigned in initialSyncWithDOM()\n\n private previousFocus?: HTMLElement|SVGElement|null;\n\n private handleKeydown!:\n SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleBodyClick!:\n SpecificEventListener<'click'>; // assigned in initialSyncWithDOM()\n\n private registerBodyClickListener!:\n RegisterFunction; // assigned in initialSyncWithDOM()\n private deregisterBodyClickListener!:\n RegisterFunction; // assigned in initialSyncWithDOM()\n\n override initialSyncWithDOM() {\n const parentEl = this.root.parentElement;\n this.anchorElement =\n parentEl && parentEl.classList.contains(cssClasses.ANCHOR) ? parentEl :\n null;\n\n if (this.root.classList.contains(cssClasses.FIXED)) {\n this.setFixedPosition(true);\n }\n\n this.handleKeydown = (event) => {\n this.foundation.handleKeydown(event);\n };\n this.handleBodyClick = (event) => {\n this.foundation.handleBodyClick(event);\n };\n\n // capture so that no race between handleBodyClick and quickOpen when\n // menusurface opened on button click which registers this listener\n this.registerBodyClickListener = () => {\n document.body.addEventListener(\n 'click', this.handleBodyClick, {capture: true});\n };\n this.deregisterBodyClickListener = () => {\n document.body.removeEventListener(\n 'click', this.handleBodyClick, {capture: true});\n };\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 override 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 /**\n * Sets the foundation to use page offsets for a positioning when the menu is\n * hoisted to the body.\n */\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 /**\n * Sets the absolute x/y position to position based on. Requires the menu to\n * be hoisted.\n */\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 override 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 order as the adapter interface.\n const adapter: MDCMenuSurfaceAdapter = {\n addClass: (className) => {\n this.root.classList.add(className);\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n hasClass: (className) => this.root.classList.contains(className),\n hasAnchor: () => !!this.anchorElement,\n notifyClose: () => {\n this.emit(MDCMenuSurfaceFoundation.strings.CLOSED_EVENT, {});\n },\n notifyClosing: () => {\n this.emit(MDCMenuSurfaceFoundation.strings.CLOSING_EVENT, {});\n },\n notifyOpen: () => {\n this.emit(MDCMenuSurfaceFoundation.strings.OPENED_EVENT, {});\n },\n notifyOpening: () => {\n this.emit(MDCMenuSurfaceFoundation.strings.OPENING_EVENT, {});\n },\n isElementInContainer: (el) => this.root.contains(el),\n isRtl: () =>\n getComputedStyle(this.root).getPropertyValue('direction') === 'rtl',\n setTransformOrigin: (origin) => {\n const propertyName =\n `${getCorrectPropertyName(window, 'transform')}-origin`;\n this.root.style.setProperty(propertyName, origin);\n },\n\n isFocused: () => document.activeElement === this.root,\n saveFocus: () => {\n this.previousFocus =\n 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 getInnerDimensions: () => {\n return {width: this.root.offsetWidth, height: this.root.offsetHeight};\n },\n getAnchorDimensions: () => this.anchorElement ?\n this.anchorElement.getBoundingClientRect() :\n null,\n getViewportDimensions: () => {\n return {width: window.innerWidth, height: window.innerHeight};\n },\n getBodyDimensions: () => {\n return {\n width: document.body.clientWidth,\n height: document.body.clientHeight\n };\n },\n getWindowScroll: () => {\n return {x: window.pageXOffset, y: window.pageYOffset};\n },\n setPosition: (position) => {\n const rootHTML = this.root;\n rootHTML.style.left = 'left' in position ? `${position.left}px` : '';\n rootHTML.style.right = 'right' in position ? `${position.right}px` : '';\n rootHTML.style.top = 'top' in position ? `${position.top}px` : '';\n rootHTML.style.bottom =\n 'bottom' in position ? `${position.bottom}px` : '';\n },\n setMaxHeight: (height) => {\n this.root.style.maxHeight = height;\n },\n registerWindowEventHandler: (evtType, handler) => {\n window.addEventListener(evtType, handler);\n },\n deregisterWindowEventHandler: (evtType, handler) => {\n window.removeEventListener(evtType, handler);\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 IS_OPEN_BELOW: 'mdc-menu-surface--is-open-below',\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 CLOSING_EVENT: 'MDCMenuSurface:closing',\n OPENED_EVENT: 'MDCMenuSurface:opened',\n OPENING_EVENT: 'MDCMenuSurface:opening',\n FOCUSABLE_ELEMENTS: [\n 'button:not(:disabled)',\n '[href]:not([aria-disabled=\"true\"])',\n 'input:not(:disabled)',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[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 /**\n * Margin left to the edge of the viewport when menu-surface is at maximum\n * possible height. Also used as a viewport margin.\n */\n MARGIN_TO_EDGE: 32,\n\n /**\n * Ratio of anchor width to menu-surface width for switching from corner\n * positioning to center positioning.\n */\n ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67,\n\n /**\n * Amount of time to wait before restoring focus when closing the menu\n * surface. This is important because if a touch event triggered the menu\n * close, and the subsequent mouse event occurs after focus is restored, then\n * the restored focus would be lost.\n */\n TOUCH_EVENT_WAIT_MS: 30,\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 =\n CornerBit.BOTTOM | CornerBit.RIGHT, // tslint:disable-line:no-bitwise\n TOP_START = CornerBit.FLIP_RTL,\n TOP_END =\n CornerBit.FLIP_RTL | CornerBit.RIGHT, // tslint:disable-line:no-bitwise\n BOTTOM_START =\n CornerBit.BOTTOM | CornerBit.FLIP_RTL, // tslint:disable-line:no-bitwise\n BOTTOM_END = CornerBit.BOTTOM | CornerBit.RIGHT |\n 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 {SpecificEventListener} from '@material/base/types';\n\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\n/** MDC Menu Surface Foundation */\nexport class MDCMenuSurfaceFoundation extends\n MDCFoundation<MDCMenuSurfaceAdapter> {\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get strings() {\n return strings;\n }\n\n static override 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 override 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 getViewportDimensions: () => ({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 notifyClosing: () => undefined,\n notifyOpen: () => undefined,\n notifyOpening: () => undefined,\n registerWindowEventHandler: () => undefined,\n deregisterWindowEventHandler: () => undefined,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private isSurfaceOpen = false;\n private isQuickOpen = false;\n private isHoistedElement = false;\n private isFixedPosition = false;\n private isHorizontallyCenteredOnViewport = false;\n\n private maxHeight = 0;\n private openBottomBias = 0;\n\n private openAnimationEndTimerId = 0;\n private closeAnimationEndTimerId = 0;\n private animationRequestId = 0;\n\n private anchorCorner: Corner = Corner.TOP_START;\n\n private resizeListener!:\n SpecificEventListener<'resize'>; // Assigned in #initialize.\n\n /**\n * Corner of the menu surface to which menu surface is attached to anchor.\n *\n * Anchor corner --->+----------+\n * | ANCHOR |\n * +----------+\n * Origin corner --->+--------------+\n * | |\n * | |\n * | MENU SURFACE |\n * | |\n * | |\n * +--------------+\n */\n private originCorner: Corner = Corner.TOP_START;\n private readonly anchorMargin:\n MDCMenuDistance = {top: 0, right: 0, bottom: 0, left: 0};\n private readonly 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 override 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.isSurfaceOpen = true;\n }\n\n this.resizeListener = this.handleResize.bind(this);\n this.adapter.registerWindowEventHandler('resize', this.resizeListener);\n }\n\n override destroy() {\n clearTimeout(this.openAnimationEndTimerId);\n clearTimeout(this.closeAnimationEndTimerId);\n // Cancel any currently running animations.\n cancelAnimationFrame(this.animationRequestId);\n\n this.adapter.deregisterWindowEventHandler('resize', this.resizeListener);\n }\n\n /**\n * @param corner Default anchor corner alignment of top-left menu surface\n * corner.\n */\n setAnchorCorner(corner: Corner) {\n this.anchorCorner = corner;\n }\n\n /**\n * Flip menu corner horizontally.\n */\n flipCornerHorizontally() {\n this.originCorner = this.originCorner ^ CornerBit.RIGHT;\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 /**\n * Used to set the menu-surface calculations based on a fixed position menu.\n */\n setFixedPosition(isFixedPosition: boolean) {\n this.isFixedPosition = isFixedPosition;\n }\n\n /**\n * @return Returns true if menu is in fixed (`position: fixed`) position.\n */\n isFixed() {\n return this.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 /** Sets whether menu-surface should be horizontally centered to viewport. */\n setIsHorizontallyCenteredOnViewport(isCentered: boolean) {\n this.isHorizontallyCenteredOnViewport = isCentered;\n }\n\n setQuickOpen(quickOpen: boolean) {\n this.isQuickOpen = quickOpen;\n }\n\n /**\n * Sets maximum menu-surface height on open.\n * @param maxHeight The desired max-height. Set to 0 (default) to\n * automatically calculate max height based on available viewport space.\n */\n setMaxHeight(maxHeight: number) {\n this.maxHeight = maxHeight;\n }\n\n /**\n * Set to a positive integer to influence the menu to preferentially open\n * below the anchor instead of above.\n * @param bias A value of `x` simulates an extra `x` pixels of available space\n * below the menu during positioning calculations.\n */\n setOpenBottomBias(bias: number) {\n this.openBottomBias = bias;\n }\n\n isOpen() {\n return this.isSurfaceOpen;\n }\n\n /**\n * Open the menu surface.\n */\n open() {\n if (this.isSurfaceOpen) {\n return;\n }\n\n this.adapter.notifyOpening();\n this.adapter.saveFocus();\n\n if (this.isQuickOpen) {\n this.isSurfaceOpen = true;\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.dimensions = this.adapter.getInnerDimensions();\n this.autoposition();\n this.adapter.notifyOpen();\n } else {\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n this.animationRequestId = requestAnimationFrame(() => {\n this.dimensions = this.adapter.getInnerDimensions();\n this.autoposition();\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.openAnimationEndTimerId = setTimeout(() => {\n this.openAnimationEndTimerId = 0;\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);\n this.adapter.notifyOpen();\n }, numbers.TRANSITION_OPEN_DURATION);\n });\n\n this.isSurfaceOpen = true;\n }\n\n this.adapter.registerWindowEventHandler('resize', this.resizeListener);\n }\n\n /**\n * Closes the menu surface.\n */\n close(skipRestoreFocus = false) {\n if (!this.isSurfaceOpen) {\n return;\n }\n\n this.adapter.notifyClosing();\n this.adapter.deregisterWindowEventHandler('resize', this.resizeListener);\n\n if (this.isQuickOpen) {\n this.isSurfaceOpen = false;\n if (!skipRestoreFocus) {\n this.maybeRestoreFocus();\n }\n\n this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);\n this.adapter.notifyClose();\n\n return;\n }\n\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n requestAnimationFrame(() => {\n this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);\n this.closeAnimationEndTimerId = setTimeout(() => {\n this.closeAnimationEndTimerId = 0;\n this.adapter.removeClass(\n MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);\n this.adapter.notifyClose();\n }, numbers.TRANSITION_CLOSE_DURATION);\n });\n\n this.isSurfaceOpen = 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 /** Handles resize events on the window. */\n private handleResize() {\n this.dimensions = this.adapter.getInnerDimensions();\n this.autoposition();\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 =\n this.hasBit(corner, CornerBit.BOTTOM) ? 'bottom' : 'top';\n let horizontalAlignment =\n 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\n // surface, otherwise keep corner.\n if (anchorSize.width / surfaceSize.width >\n 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\n // to the anchor element\n if (this.isHoistedElement || this.isFixedPosition) {\n this.adjustPositionForHoistedElement(position);\n }\n\n this.adapter.setTransformOrigin(\n `${horizontalAlignment} ${verticalAlignment}`);\n this.adapter.setPosition(position);\n this.adapter.setMaxHeight(\n maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');\n\n // If it is opened from the top then add is-open-below class\n if (!this.hasBit(corner, CornerBit.BOTTOM)) {\n this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);\n }\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.getViewportDimensions();\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 } as any;\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\n * menu surface.\n *\n * Only LEFT or RIGHT bit is used to position the menu surface ignoring RTL\n * context. E.g., menu surface will be positioned from right side on TOP_END.\n */\n private getoriginCorner(): Corner {\n let corner = this.originCorner;\n\n const {viewportDistance, anchorSize, surfaceSize} = this.measurements;\n const {MARGIN_TO_EDGE} = MDCMenuSurfaceFoundation.numbers;\n\n const isAnchoredToBottom = this.hasBit(this.anchorCorner, CornerBit.BOTTOM);\n\n let availableTop;\n let availableBottom;\n if (isAnchoredToBottom) {\n availableTop =\n viewportDistance.top - MARGIN_TO_EDGE + this.anchorMargin.bottom;\n availableBottom =\n viewportDistance.bottom - MARGIN_TO_EDGE - this.anchorMargin.bottom;\n } else {\n availableTop =\n viewportDistance.top - MARGIN_TO_EDGE + this.anchorMargin.top;\n availableBottom = viewportDistance.bottom - MARGIN_TO_EDGE +\n anchorSize.height - this.anchorMargin.top;\n }\n\n const isAvailableBottom = availableBottom - surfaceSize.height > 0;\n if (!isAvailableBottom &&\n availableTop > availableBottom + this.openBottomBias) {\n // Attach bottom side of surface to the anchor.\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 hasRightBit = this.hasBit(this.anchorCorner, CornerBit.RIGHT) ||\n this.hasBit(corner, CornerBit.RIGHT);\n\n // Whether surface attached to right side of anchor element.\n let isAnchoredToRight = false;\n\n // Anchored to start\n if (isRtl && isFlipRtl) {\n isAnchoredToRight = !hasRightBit;\n } else {\n // Anchored to right\n isAnchoredToRight = hasRightBit;\n }\n\n let availableLeft;\n let availableRight;\n if (isAnchoredToRight) {\n availableLeft =\n viewportDistance.left + anchorSize.width + this.anchorMargin.left;\n availableRight = viewportDistance.right - this.anchorMargin.left;\n } else {\n availableLeft = viewportDistance.left + this.anchorMargin.left;\n availableRight =\n viewportDistance.right + anchorSize.width - this.anchorMargin.left;\n }\n\n const isAvailableLeft = availableLeft - surfaceSize.width > 0;\n const isAvailableRight = availableRight - surfaceSize.width > 0;\n const isOriginCornerAlignedToEnd =\n this.hasBit(corner, CornerBit.FLIP_RTL) &&\n this.hasBit(corner, CornerBit.RIGHT);\n\n if (isAvailableRight && isOriginCornerAlignedToEnd && isRtl ||\n !isAvailableLeft && isOriginCornerAlignedToEnd) {\n // Attach left side of surface to the anchor.\n corner = this.unsetBit(corner, CornerBit.RIGHT);\n } else if (\n isAvailableLeft && isAnchoredToRight && isRtl ||\n (isAvailableLeft && !isAnchoredToRight && hasRightBit) ||\n (!isAvailableRight && availableLeft >= availableRight)) {\n // Attach right side of surface to the anchor.\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\n * indicates should not be set.\n */\n private getMenuSurfaceMaxHeight(corner: Corner): number {\n if (this.maxHeight > 0) {\n return this.maxHeight;\n }\n\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 = viewportDistance.bottom - this.anchorMargin.bottom +\n 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\n * 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 =\n this.hasBit(this.anchorCorner, CornerBit.RIGHT);\n\n if (isRightAligned) {\n const rightOffset = avoidHorizontalOverlap ?\n anchorSize.width - this.anchorMargin.left :\n this.anchorMargin.right;\n\n // For hoisted or fixed elements, adjust the offset by the difference\n // between viewport width and body width so when we calculate the right\n // value (`adjustPositionForHoistedElement`) based on the element\n // position, the right property is correct.\n if (this.isHoistedElement || this.isFixedPosition) {\n return rightOffset -\n (this.measurements.viewportSize.width -\n this.measurements.bodySize.width);\n }\n\n return rightOffset;\n }\n\n return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin.right :\n 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\n * 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 =\n this.hasBit(this.anchorCorner, CornerBit.BOTTOM);\n\n let y = 0;\n if (isBottomAligned) {\n y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin.top :\n -this.anchorMargin.bottom;\n } else {\n y = avoidVerticalOverlap ?\n (anchorSize.height + this.anchorMargin.bottom) :\n this.anchorMargin.top;\n }\n return y;\n }\n\n /**\n * Calculates the offsets for positioning the menu-surface when the\n * menu-surface has been hoisted to the body.\n */\n private adjustPositionForHoistedElement(position: Partial<MDCMenuDistance>) {\n const {windowScroll, viewportDistance, surfaceSize, viewportSize} =\n this.measurements;\n\n const props =\n Object.keys(position) as Array<keyof Partial<MDCMenuDistance>>;\n\n for (const prop of props) {\n let value = position[prop] || 0;\n\n if (this.isHorizontallyCenteredOnViewport &&\n (prop === 'left' || prop === 'right')) {\n position[prop] = (viewportSize.width - surfaceSize.width) / 2;\n continue;\n }\n\n // Hoisted surfaces need to have the anchor elements location on the page\n // added to the position properties for proper alignment on the body.\n value += viewportDistance[prop];\n\n // Surfaces that are absolutely positioned need to have additional\n // calculations for scroll 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\n * focus, if the user is focused on or within the menu surface when it is\n * closed.\n */\n private maybeRestoreFocus() {\n const isRootFocused = this.adapter.isFocused();\n const ownerDocument = this.adapter.getOwnerDocument ?\n this.adapter.getOwnerDocument() :\n document;\n const childHasFocus = ownerDocument.activeElement &&\n this.adapter.isElementInContainer(ownerDocument.activeElement);\n if (isRootFocused || childHasFocus) {\n // Wait before restoring focus when closing the menu surface. This is\n // important because if a touch event triggered the menu close, and the\n // subsequent mouse event occurs after focus is restored, then the\n // restored focus would be lost.\n setTimeout(() => {\n this.adapter.restoreFocus();\n }, numbers.TOUCH_EVENT_WAIT_MS);\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 private unsetBit(corner: Corner, bit: CornerBit): Corner {\n return corner ^ bit;\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 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 {numbers as listConstants} from '@material/list/constants';\nimport {MDCListFoundation} from '@material/list/foundation';\nimport {MDCListActionEvent, MDCListIndex} 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';\n\nimport {MDCMenuAdapter} from './adapter';\nimport {cssClasses, DefaultFocusState, strings} from './constants';\nimport {MDCMenuFoundation} from './foundation';\nimport {MDCMenuItemComponentEventDetail} from './types';\n\n/** MDC Menu Factory */\nexport type MDCMenuFactory =\n (el: HTMLElement, foundation?: MDCMenuFoundation) => MDCMenu;\n\n/** MDC Menu */\nexport class MDCMenu extends MDCComponent<MDCMenuFoundation> {\n static override attachTo(root: HTMLElement) {\n return new MDCMenu(root);\n }\n\n private menuSurfaceFactory!:\n 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!:\n SpecificEventListener<'keydown'>; // assigned in initialSyncWithDOM()\n private handleItemAction!:\n CustomEventListener<MDCListActionEvent>; // assigned in\n // initialSyncWithDOM()\n private handleMenuSurfaceOpened!:\n EventListener; // assigned in initialSyncWithDOM()\n\n override initialize(\n menuSurfaceFactory:\n MDCMenuSurfaceFactory = (el) => new MDCMenuSurface(el),\n listFactory: MDCListFactory = (el) => new MDCList(el)) {\n this.menuSurfaceFactory = menuSurfaceFactory;\n this.listFactory = listFactory;\n }\n\n override initialSyncWithDOM() {\n this.menuSurface = this.menuSurfaceFactory(this.root);\n\n const list = this.root.querySelector<HTMLElement>(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) => {\n this.foundation.handleKeydown(evt);\n };\n this.handleItemAction = (evt) => {\n this.foundation.handleItemAction(this.items[evt.detail.index]);\n };\n this.handleMenuSurfaceOpened = () => {\n this.foundation.handleMenuSurfaceOpened();\n };\n\n this.menuSurface.listen(\n MDCMenuSurfaceFoundation.strings.OPENED_EVENT,\n this.handleMenuSurfaceOpened);\n this.listen('keydown', this.handleKeydown);\n this.listen(MDCListFoundation.strings.ACTION_EVENT, this.handleItemAction);\n }\n\n override destroy() {\n if (this.list) {\n this.list.destroy();\n }\n\n this.menuSurface.destroy();\n this.menuSurface.unlisten(\n MDCMenuSurfaceFoundation.strings.OPENED_EVENT,\n this.handleMenuSurfaceOpened);\n this.unlisten('keydown', this.handleKeydown);\n this.unlisten(\n 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 * Sets whether the menu has typeahead functionality.\n * @param value Whether typeahead is enabled.\n */\n set hasTypeahead(value: boolean) {\n if (this.list) {\n this.list.hasTypeahead = value;\n }\n }\n\n /**\n * @return Whether typeahead logic is currently matching some user prefix.\n */\n get typeaheadInProgress() {\n return this.list ? this.list.typeaheadInProgress : false;\n }\n\n /**\n * Given the next desired character from the user, adds it to the typeahead\n * buffer. Then, attempts to find the next option matching the buffer. Wraps\n * around if at the end of options.\n *\n * @param nextChar The next character to add to the prefix buffer.\n * @param startingIndex The index from which to start matching. Only relevant\n * when starting a new match sequence. To start a new match sequence,\n * clear the buffer using `clearTypeaheadBuffer`, or wait for the buffer\n * to clear after a set interval defined in list foundation. Defaults to\n * the currently focused index.\n * @return The index of the matched item, or -1 if no match.\n */\n typeaheadMatchItem(nextChar: string, startingIndex?: number): number {\n if (this.list) {\n return this.list.typeaheadMatchItem(nextChar, startingIndex);\n }\n return -1;\n }\n\n /**\n * Layout the underlying list element in the case of any dynamic updates\n * to its structure.\n */\n layout() {\n if (this.list) {\n this.list.layout();\n }\n }\n\n /**\n * Return the items within the menu. Note that this only contains the set of\n * elements within the items container that are proper list items, and not\n * supplemental / presentational DOM elements.\n */\n get items(): HTMLElement[] {\n return this.list ? this.list.listElements : [];\n }\n\n /**\n * Turns on/off the underlying list's single selection mode. Used mainly\n * by select menu.\n *\n * @param singleSelection Whether to enable single selection mode.\n */\n set singleSelection(singleSelection: boolean) {\n if (this.list) {\n this.list.singleSelection = singleSelection;\n }\n }\n\n /**\n * Retrieves the selected index. Only applicable to select menus.\n * @return The selected index, which is a number for single selection and\n * radio lists, and an array of numbers for checkbox lists.\n */\n get selectedIndex(): MDCListIndex {\n return this.list ? this.list.selectedIndex : listConstants.UNSET_INDEX;\n }\n\n /**\n * Sets the selected index of the list. Only applicable to select menus.\n * @param index The selected index, which is a number for single selection and\n * radio lists, and an array of numbers for checkbox lists.\n */\n set selectedIndex(index: MDCListIndex) {\n if (this.list) {\n this.list.selectedIndex = index;\n }\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 /**\n * @param index A menu item's index.\n * @return The primary text within the menu at the index specified.\n */\n getPrimaryTextAtIndex(index: number): string {\n const item = this.getOptionByIndex(index);\n if (item && this.list) {\n return this.list.getPrimaryText(item) || '';\n }\n return '';\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 override 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 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 this.safeSetAttribute(list[index], attr, value);\n },\n removeAttributeFromElementAtIndex: (index, attr) => {\n const list = this.items;\n list[index].removeAttribute(attr);\n },\n getAttributeFromElementAtIndex: (index, attr) => {\n const list = this.items;\n return list[index].getAttribute(attr);\n },\n elementContainsClass: (element, className) =>\n element.classList.contains(className),\n closeSurface: (skipRestoreFocus: boolean) => {\n this.menuSurface.close(skipRestoreFocus);\n },\n getElementIndex: (element) => this.items.indexOf(element),\n notifySelected: (evtData) => {\n this.emit<MDCMenuItemComponentEventDetail>(strings.SELECTED_EVENT, {\n index: evtData.index,\n item: this.items[evtData.index],\n });\n },\n getMenuItemCount: () => this.items.length,\n focusItemAtIndex: (index) => {\n this.items[index].focus();\n },\n focusListRoot: () => {\n this.root.querySelector<HTMLElement>(strings.LIST_SELECTOR)!.focus();\n },\n isSelectableItemAtIndex: (index) =>\n !!closest(this.items[index], `.${cssClasses.MENU_SELECTION_GROUP}`),\n getSelectedSiblingOfItemAtIndex: (index) => {\n const selectionGroupEl =\n closest(this.items[index], `.${cssClasses.MENU_SELECTION_GROUP}`) as\n HTMLElement;\n const selectedItemEl = selectionGroupEl.querySelector<HTMLElement>(\n `.${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,.mdc-deprecated-list',\n SELECTED_EVENT: 'MDCMenu:selected',\n SKIP_RESTORE_FOCUS: 'data-menu-item-skip-restore-focus',\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';\n\nimport {MDCMenuAdapter} from './adapter';\nimport {cssClasses, DefaultFocusState, numbers, strings} from './constants';\n\n/** MDC Menu Foundation */\nexport class MDCMenuFoundation extends MDCFoundation<MDCMenuAdapter> {\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get strings() {\n return strings;\n }\n\n static override get numbers() {\n return numbers;\n }\n\n private defaultFocusState = DefaultFocusState.LIST_ROOT;\n private selectedIndex = -1;\n\n /**\n * @see {@link MDCMenuAdapter} for typing information on parameters and return types.\n */\n static override 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 getAttributeFromElementAtIndex: () => null,\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 override destroy() {\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: HTMLElement) {\n const index = this.adapter.getElementIndex(listItem);\n if (index < 0) {\n return;\n }\n\n this.adapter.notifySelected({index});\n const skipRestoreFocus = this.adapter.getAttributeFromElementAtIndex(\n index, strings.SKIP_RESTORE_FOCUS) === 'true';\n this.adapter.closeSurface(skipRestoreFocus);\n\n if (this.adapter.isSelectableItemAtIndex(index)) {\n this.setSelectedIndex(index);\n }\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 /** @return Index of the currently selected list item within the menu. */\n getSelectedIndex() {\n return this.selectedIndex;\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(\n 'MDCMenuFoundation: No selection group at specified index.');\n }\n\n const prevSelectedIndex =\n this.adapter.getSelectedSiblingOfItemAtIndex(index);\n if (prevSelectedIndex >= 0) {\n this.adapter.removeAttributeFromElementAtIndex(\n prevSelectedIndex, strings.ARIA_CHECKED_ATTR);\n this.adapter.removeClassFromElementAtIndex(\n prevSelectedIndex, cssClasses.MENU_SELECTED_LIST_ITEM);\n }\n\n this.adapter.addClassToElementAtIndex(\n index, cssClasses.MENU_SELECTED_LIST_ITEM);\n this.adapter.addAttributeToElementAtIndex(\n index, strings.ARIA_CHECKED_ATTR, 'true');\n\n this.selectedIndex = 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.validatedIndex(index);\n\n if (isEnabled) {\n this.adapter.removeClassFromElementAtIndex(\n index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.addAttributeToElementAtIndex(\n index, strings.ARIA_DISABLED_ATTR, 'false');\n } else {\n this.adapter.addClassToElementAtIndex(\n index, listCssClasses.LIST_ITEM_DISABLED_CLASS);\n this.adapter.addAttributeToElementAtIndex(\n 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 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';\n\nimport {MDCNotchedOutlineAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\nimport {MDCNotchedOutlineFoundation} from './foundation';\n\n/** MDC Notched Outline Factory */\nexport type MDCNotchedOutlineFactory =\n (el: HTMLElement, foundation?: MDCNotchedOutlineFoundation) =>\n MDCNotchedOutline;\n\n/** MDC Notched Outline */\nexport class MDCNotchedOutline extends\n MDCComponent<MDCNotchedOutlineFoundation> {\n static override attachTo(root: HTMLElement): MDCNotchedOutline {\n return new MDCNotchedOutline(root);\n }\n\n private notchElement!: HTMLElement; // assigned in initialSyncWithDOM()\n\n override initialSyncWithDOM() {\n this.notchElement =\n this.root.querySelector<HTMLElement>(strings.NOTCH_ELEMENT_SELECTOR)!;\n\n const label = this.root.querySelector<HTMLElement>(\n '.' + 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 override 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 order as the adapter interface.\n const adapter: MDCNotchedOutlineAdapter = {\n addClass: (className) => {\n this.root.classList.add(className);\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n setNotchWidthProperty: (width) => {\n this.notchElement.style.setProperty('width', width + 'px');\n },\n removeNotchWidthProperty: () => {\n this.notchElement.style.removeProperty('width');\n },\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';\n\nimport {MDCNotchedOutlineAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\n\n/** MDC Notched Outline Foundation */\nexport class MDCNotchedOutlineFoundation extends\n MDCFoundation<MDCNotchedOutlineAdapter> {\n static override get strings() {\n return strings;\n }\n\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get numbers() {\n return numbers;\n }\n\n /**\n * See {@link MDCNotchedOutlineAdapter} for typing information on parameters\n * and return types.\n */\n static override 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\n * based off of notchWidth.\n */\n notch(notchWidth: number) {\n const {OUTLINE_NOTCHED} = MDCNotchedOutlineFoundation.cssClasses;\n\n if (notchWidth > 0) {\n notchWidth +=\n 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 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';\n\nimport {MDCRippleAdapter} from './adapter';\nimport {MDCRippleFoundation} from './foundation';\nimport {MDCRippleAttachOpts, MDCRippleCapableSurface} from './types';\nimport * as util from './util';\n\n/** MDC Ripple Factory */\nexport type MDCRippleFactory =\n (el: HTMLElement, foundation?: MDCRippleFoundation) => MDCRipple;\n\n/** MDC Ripple */\nexport class MDCRipple extends MDCComponent<MDCRippleFoundation> implements\n MDCRippleCapableSurface {\n static override attachTo(root: HTMLElement, opts: MDCRippleAttachOpts = {\n isUnbounded: undefined\n }): 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) => {\n instance.root.classList.add(className);\n },\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(\n evtType, handler, applyPassive());\n },\n deregisterInteractionHandler: (evtType, handler) => {\n instance.root.removeEventListener(evtType, handler, applyPassive());\n },\n deregisterResizeHandler: (handler) => {\n window.removeEventListener('resize', handler);\n },\n getWindowPageOffset: () =>\n ({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(\n evtType, handler, applyPassive());\n },\n registerInteractionHandler: (evtType, handler) => {\n instance.root.addEventListener(evtType, handler, applyPassive());\n },\n registerResizeHandler: (handler) => {\n window.addEventListener('resize', handler);\n },\n removeClass: (className) => {\n instance.root.classList.remove(className);\n },\n updateCssVariable: (varName, value) => {\n instance.root.style.setProperty(varName, value);\n },\n };\n }\n\n disabled = false;\n\n private isUnbounded?: boolean;\n\n get unbounded(): boolean {\n return Boolean(this.isUnbounded);\n }\n\n set unbounded(unbounded: boolean) {\n this.isUnbounded = 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 override getDefaultFoundation() {\n return new MDCRippleFoundation(MDCRipple.createAdapter(this));\n }\n\n override initialSyncWithDOM() {\n const root = this.root;\n this.isUnbounded = '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.isUnbounded));\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\n // sorts,\n // given that it's an 'upgrade' to an existing component. That being said it\n // 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:\n 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation\n // animation duration)\n FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration\n // (i.e. deactivation animation duration)\n INITIAL_ORIGIN_SCALE: 0.6,\n PADDING: 10,\n TAP_DELAY_MS:\n 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';\n\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\ninterface EventHandlerNonNull {\n (event: Event): any;\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\n// activation\nconst ACTIVATION_EVENT_TYPES: ActivationEventType[] = [\n 'touchstart',\n 'pointerdown',\n 'mousedown',\n 'keydown',\n];\n\n// Deactivation events registered on documentElement when a pointer-related down\n// event occurs\nconst POINTER_DEACTIVATION_EVENT_TYPES: DeactivationEventType[] = [\n 'touchend',\n 'pointerup',\n 'mouseup',\n 'contextmenu',\n];\n\n// simultaneous nested activations\nlet activatedTargets: Array<EventTarget|null> = [];\n\n/** MDC Ripple Foundation */\nexport class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get strings() {\n return strings;\n }\n\n static override get numbers() {\n return numbers;\n }\n\n static override get defaultAdapter(): MDCRippleAdapter {\n return {\n addClass: () => undefined,\n browserSupportsCssVars: () => true,\n computeBoundingRect: () =>\n ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0} as any),\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) => {\n this.activateImpl(e);\n };\n this.deactivateHandler = () => {\n this.deactivateImpl();\n };\n this.focusHandler = () => {\n this.handleFocus();\n };\n this.blurHandler = () => {\n this.handleBlur();\n };\n this.resizeHandler = () => {\n this.layout();\n };\n }\n\n override 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\n // coordinates for both shade and ripple\n this.layoutInternal();\n }\n });\n }\n }\n\n override 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(\n 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.activateImpl(evt);\n }\n\n deactivate(): void {\n this.deactivateImpl();\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\n handleBlur(): void {\n requestAnimationFrame(() => {\n this.adapter.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);\n });\n }\n\n /**\n * We compute this property so that we are not querying information about the\n * client until the point in time where the foundation requests it. This\n * prevents scenarios where client-side feature-detection may happen too\n * early, such as when components are rendered on the server and then\n * 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 for (const evtType of ACTIVATION_EVENT_TYPES) {\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 for (const evtType of POINTER_DEACTIVATION_EVENT_TYPES) {\n this.adapter.registerDocumentInteractionHandler(\n evtType, this.deactivateHandler);\n }\n }\n }\n\n private deregisterRootHandlers() {\n for (const evtType of ACTIVATION_EVENT_TYPES) {\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 for (const evtType of POINTER_DEACTIVATION_EVENT_TYPES) {\n this.adapter.deregisterDocumentInteractionHandler(\n evtType, this.deactivateHandler);\n }\n }\n\n private removeCssVars() {\n const rippleStrings = MDCRippleFoundation.strings;\n const keys =\n 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 activateImpl(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\n // already-processed user interaction\n const previousActivationEvent = this.previousActivationEvent;\n const isSameInteraction = previousActivationEvent && evt !== undefined &&\n 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 ?\n false :\n evt !== undefined &&\n (evt.type === 'mousedown' || evt.type === 'touchstart' ||\n evt.type === 'pointerdown');\n\n const hasActivatedChild = evt !== undefined &&\n activatedTargets.length > 0 &&\n activatedTargets.some(\n (target) => this.adapter.containsEventTarget(target));\n if (hasActivatedChild) {\n // Immediately reset activation state, while preserving logic that\n // 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\n // bubble to prevent ancestor ripples\n activatedTargets = [];\n\n if (!activationState.wasElementMadeActive && evt !== undefined &&\n ((evt as KeyboardEvent).key === ' ' ||\n (evt as KeyboardEvent).keyCode === 32)) {\n // If space was pressed, try again within an rAF call to detect :active,\n // because different UAs report active states inconsistently when\n // 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\n // problem, but will crash if a CSS variable is set within a rAF\n // 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') ?\n this.adapter.isSurfaceActive() :\n true;\n }\n\n private animateActivation() {\n const {VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END} =\n 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(() => {\n this.activationTimerCallback();\n }, 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\n // the activation animation ends. The deactivation animation should only run\n // 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\n // a short time. Store the previous event until it's safe to assume that\n // subsequent events are for new interactions.\n setTimeout(\n () => this.previousActivationEvent = undefined,\n MDCRippleFoundation.numbers.TAP_DELAY_MS);\n }\n\n private deactivateImpl(): void {\n const activationState = this.activationState;\n // This can happen in scenarios such as when you have a keyup event that\n // blurs the element.\n if (!activationState.isActivated) {\n return;\n }\n\n const state: ActivationStateType = {...activationState};\n\n if (activationState.isProgrammatic) {\n requestAnimationFrame(() => {\n this.animateDeactivation(state);\n });\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}:\n 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\n // ripples. Unbounded ripple diameter is calculated smaller since the\n // surface is expected to already be padded appropriately to extend the\n // hitbox, and the ripple is expected to meet the edges of the padded hitbox\n // (which is typically square). Bounded ripples, on the other hand, are\n // fully expected to expand beyond the surface's longest diameter\n // (calculated based on the diagonal plus a constant padding), and are\n // clipped at the surface's border via `overflow: hidden`.\n const getBoundedRadius = () => {\n const hypotenuse = Math.sqrt(\n 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,\n // then scales up using a CSS scale transform\n const initialSize =\n Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);\n // Unbounded ripple size should always be even number to equally center\n // 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,\n VAR_LEFT,\n VAR_TOP,\n 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(\n 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 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(\n windowObj: typeof globalThis, 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)') && CSS.supports('color', '#00000000'));\n\n supportsCssVars =\n explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;\n\n if (!forceRefresh) {\n supportsCssVariables_ = supportsCssVars;\n }\n return supportsCssVars;\n}\n\nexport function getNormalizedEventCoords(\n evt: Event|undefined, pageOffset: MDCRipplePoint,\n clientRect: DOMRect): 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 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 {Corner} from '@material/menu-surface/constants';\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCSelectAdapter {\n /**\n * Adds class to select anchor element.\n */\n addClass(className: string): void;\n\n /**\n * Removes a class from the select anchor element.\n */\n removeClass(className: string): void;\n\n /**\n * Returns true if the select anchor element contains the given class name.\n */\n hasClass(className: string): boolean;\n\n /**\n * Activates the bottom line, showing a focused state.\n */\n activateBottomLine(): void;\n\n /**\n * Deactivates the bottom line.\n */\n deactivateBottomLine(): void;\n\n /**\n * Returns true if label exists, false if it doesn't.\n */\n hasLabel(): boolean;\n\n /**\n * Floats label determined based off of the shouldFloat argument.\n */\n floatLabel(shouldFloat: boolean): void;\n\n /**\n * Returns width of label in pixels, if the label exists.\n */\n getLabelWidth(): number;\n\n /**\n * Styles the label as required, if the label exists.\n */\n setLabelRequired(isRequired: boolean): void;\n\n /**\n * Returns true if outline element exists, false if it doesn't.\n */\n hasOutline(): boolean;\n\n /**\n * Only implement if outline element exists.\n */\n notchOutline(labelWidth: number): void;\n\n /**\n * Closes notch in outline element, if the outline exists.\n */\n closeOutline(): void;\n\n /**\n * Sets the line ripple transform origin center.\n */\n setRippleCenter(normalizedX: number): void;\n\n /**\n * Emits a change event when an element is selected.\n */\n notifyChange(value: string): void;\n\n /**\n * Sets the text content of the selectedText element to the given string.\n */\n setSelectedText(text: string): void;\n\n /**\n * Returns whether the select anchor is focused.\n */\n isSelectAnchorFocused(): boolean;\n\n /**\n * Gets the given attribute on the select anchor element.\n */\n getSelectAnchorAttr(attr: string): string|null;\n\n /**\n * Sets the given attribute on the select anchor element.\n */\n setSelectAnchorAttr(attr: string, value: string): void;\n\n /**\n * Removes the given attribute on the select anchor element.\n */\n removeSelectAnchorAttr(attr: string): void;\n\n // Menu-related methods ======================================================\n /**\n * Adds class to the menu element.\n */\n addMenuClass(className: string): void;\n\n /**\n * Removes a class from the menu element.\n */\n removeMenuClass(className: string): void;\n\n /**\n * Opens the menu.\n */\n openMenu(): void;\n\n /**\n * Closes the menu.\n */\n closeMenu(): void;\n\n /**\n * Returns the select anchor element.\n */\n getAnchorElement(): Element|null;\n\n /**\n * Sets the menu anchor element.\n */\n setMenuAnchorElement(anchorEl: Element): void;\n\n /**\n * Sets the menu anchor corner.\n */\n setMenuAnchorCorner(anchorCorner: Corner): void;\n\n /**\n * Sets whether the menu should wrap focus.\n */\n setMenuWrapFocus(wrapFocus: boolean): void;\n\n /**\n * Focuses the menu item element at the given index.\n */\n focusMenuItemAtIndex(index: number): void;\n\n /**\n * Returns the number of menu items.\n */\n getMenuItemCount(): number;\n\n /**\n * Returns an array representing the VALUE_ATTR attributes of each menu item.\n */\n getMenuItemValues(): string[];\n\n /**\n * Gets the text content of the menu item element at the given index.\n */\n getMenuItemTextAtIndex(index: number): string;\n\n /**\n * Returns the selected index.\n */\n getSelectedIndex(): number;\n\n /**\n * Sets the selected index in the menu.\n */\n setSelectedIndex(index: number): void;\n\n /**\n * Returns whether typeahead is in progress in the menu.\n */\n isTypeaheadInProgress(): boolean;\n\n /**\n * Adds a character to the list typeahead buffer and returns index of the\n * next item in the list matching the buffer.\n */\n typeaheadMatchItem(nextChar: string, startingIndex: number): number;\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';\n\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\n/** MDC Select */\nexport class MDCSelect extends MDCComponent<MDCSelectFoundation> {\n static override attachTo(root: HTMLElement): MDCSelect {\n return new MDCSelect(root);\n }\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 private hiddenInput!: HTMLInputElement|null; // assigned in initialize()\n\n private menuElement!: HTMLElement; // assigned in menuSetup()\n private menuItemValues!: string[]; // 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\n // Event handlers\n private handleFocus!: SpecificEventListener<'focus'>;\n private handleBlur!: SpecificEventListener<'blur'>;\n private handleClick!: SpecificEventListener<'click'>;\n private handleKeydown!: SpecificEventListener<'keydown'>;\n private handleMenuOpened!: EventListener;\n private handleMenuClosed!: EventListener;\n private handleMenuClosing!: EventListener;\n private handleMenuItemAction!: CustomEventListener<MDCMenuItemEvent>;\n\n override initialize(\n labelFactory: MDCFloatingLabelFactory = (el) => new MDCFloatingLabel(el),\n lineRippleFactory: MDCLineRippleFactory = (el) => new MDCLineRipple(el),\n outlineFactory:\n MDCNotchedOutlineFactory = (el) => new MDCNotchedOutline(el),\n menuFactory: MDCMenuFactory = (el) => new MDCMenu(el),\n iconFactory: MDCSelectIconFactory = (el) => new MDCSelectIcon(el),\n helperTextFactory:\n MDCSelectHelperTextFactory = (el) => new MDCSelectHelperText(el),\n ) {\n this.selectAnchor =\n this.root.querySelector<HTMLElement>(strings.SELECT_ANCHOR_SELECTOR)!;\n this.selectedText =\n this.root.querySelector<HTMLElement>(strings.SELECTED_TEXT_SELECTOR)!;\n this.hiddenInput = this.root.querySelector<HTMLInputElement>(\n strings.HIDDEN_INPUT_SELECTOR)!;\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.selectAnchor.hasAttribute(strings.ARIA_CONTROLS)) {\n const helperTextElement = document.getElementById(\n this.selectAnchor.getAttribute(strings.ARIA_CONTROLS)!);\n if (helperTextElement) {\n this.helperText = helperTextFactory(helperTextElement);\n }\n }\n\n this.menuSetup(menuFactory);\n\n const labelElement =\n this.root.querySelector<HTMLElement>(strings.LABEL_SELECTOR);\n this.label = labelElement ? labelFactory(labelElement) : null;\n\n const lineRippleElement =\n this.root.querySelector<HTMLElement>(strings.LINE_RIPPLE_SELECTOR);\n this.lineRipple =\n lineRippleElement ? lineRippleFactory(lineRippleElement) : null;\n\n const outlineElement =\n this.root.querySelector<HTMLElement>(strings.OUTLINE_SELECTOR);\n this.outline = outlineElement ? outlineFactory(outlineElement) : null;\n\n const leadingIcon =\n this.root.querySelector<HTMLElement>(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 override initialSyncWithDOM() {\n this.handleFocus = () => {\n this.foundation.handleFocus();\n };\n this.handleBlur = () => {\n this.foundation.handleBlur();\n };\n this.handleClick = (evt) => {\n this.selectAnchor.focus();\n this.foundation.handleClick(this.getNormalizedXCoordinate(evt));\n };\n this.handleKeydown = (evt) => {\n this.foundation.handleKeydown(evt);\n };\n this.handleMenuItemAction = (evt) => {\n this.foundation.handleMenuItemAction(evt.detail.index);\n };\n this.handleMenuOpened = () => {\n this.foundation.handleMenuOpened();\n };\n this.handleMenuClosed = () => {\n this.foundation.handleMenuClosed();\n };\n this.handleMenuClosing = () => {\n this.foundation.handleMenuClosing();\n };\n\n this.selectAnchor.addEventListener('focus', this.handleFocus);\n this.selectAnchor.addEventListener('blur', this.handleBlur);\n\n this.selectAnchor.addEventListener(\n 'click', this.handleClick as EventListener);\n\n this.selectAnchor.addEventListener('keydown', this.handleKeydown);\n this.menu.listen(\n menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed);\n this.menu.listen(\n menuSurfaceConstants.strings.CLOSING_EVENT, this.handleMenuClosing);\n this.menu.listen(\n menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened);\n this.menu.listen(\n menuConstants.strings.SELECTED_EVENT, this.handleMenuItemAction);\n\n if (this.hiddenInput) {\n if (this.hiddenInput.value) {\n // If the hidden input already has a value, use it to restore the\n // select's value. This can happen e.g. if the user goes back or (in\n // some browsers) refreshes the page.\n this.foundation.setValue(\n this.hiddenInput.value, /** skipNotify */ true);\n this.foundation.layout();\n return;\n }\n\n this.hiddenInput.value = this.value;\n }\n }\n\n override destroy() {\n this.selectAnchor.removeEventListener('focus', this.handleFocus);\n this.selectAnchor.removeEventListener('blur', this.handleBlur);\n this.selectAnchor.removeEventListener('keydown', this.handleKeydown);\n this.selectAnchor.removeEventListener(\n 'click', this.handleClick as EventListener);\n\n this.menu.unlisten(\n menuSurfaceConstants.strings.CLOSED_EVENT, this.handleMenuClosed);\n this.menu.unlisten(\n menuSurfaceConstants.strings.OPENED_EVENT, this.handleMenuOpened);\n this.menu.unlisten(\n 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 setValue(value: string, skipNotify = false) {\n this.foundation.setValue(value, skipNotify);\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 setSelectedIndex(selectedIndex: number, skipNotify = false) {\n this.foundation.setSelectedIndex(\n selectedIndex, /* closeMenu */ true, skipNotify);\n }\n\n get disabled(): boolean {\n return this.foundation.getDisabled();\n }\n\n set disabled(disabled: boolean) {\n this.foundation.setDisabled(disabled);\n if (this.hiddenInput) {\n this.hiddenInput.disabled = disabled;\n }\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 * Enables or disables the default validation scheme where a required select\n * must be non-empty. Set to false for custom validation.\n * @param useDefaultValidation Set this to false to ignore default\n * validation scheme.\n */\n set useDefaultValidation(useDefaultValidation: boolean) {\n this.foundation.setUseDefaultValidation(useDefaultValidation);\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 * Re-calculates if the notched outline should be notched and if the label\n * should float.\n */\n layout() {\n this.foundation.layout();\n }\n\n /**\n * Synchronizes the list of options with the state of the foundation. Call\n * this whenever menu options are dynamically updated.\n */\n layoutOptions() {\n this.foundation.layoutOptions();\n this.menu.layout();\n // Update cached menuItemValues for adapter.\n this.menuItemValues =\n this.menu.items.map((el) => el.getAttribute(strings.VALUE_ATTR) || '');\n\n if (this.hiddenInput) {\n this.hiddenInput.value = this.value;\n }\n }\n\n override 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 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 =\n this.root.querySelector<HTMLElement>(strings.MENU_SELECTOR)!;\n this.menu = menuFactory(this.menuElement);\n this.menu.hasTypeahead = true;\n this.menu.singleSelection = true;\n this.menuItemValues =\n this.menu.items.map((el) => el.getAttribute(strings.VALUE_ATTR) || '');\n }\n\n private createRipple(): MDCRipple {\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 order as the adapter interface.\n const adapter: MDCRippleAdapter = {\n ...MDCRipple.createAdapter({root: this.selectAnchor}),\n registerInteractionHandler: (evtType, handler) => {\n this.selectAnchor.addEventListener(evtType, handler);\n },\n deregisterInteractionHandler: (evtType, handler) => {\n this.selectAnchor.removeEventListener(evtType, handler);\n },\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 getMenuItemAttr: (menuItem: Element, attr: string) =>\n menuItem.getAttribute(attr),\n setSelectedText: (text: string) => {\n this.selectedText.textContent = text;\n\n let index = this.menu.selectedIndex;\n if (index === -1) return;\n index = index instanceof Array ? index[0] : index;\n const selectedItem = this.menu.items[index];\n if (!selectedItem) return;\n this.selectedText.setAttribute(\n 'aria-label', selectedItem.getAttribute('aria-label') || '');\n },\n isSelectAnchorFocused: () => document.activeElement === this.selectAnchor,\n getSelectAnchorAttr: (attr: string) =>\n this.selectAnchor.getAttribute(attr),\n setSelectAnchorAttr: (attr: string, value: string) => {\n this.safeSetAttribute(this.selectAnchor, attr, value);\n },\n removeSelectAnchorAttr: (attr: string) => {\n this.selectAnchor.removeAttribute(attr);\n },\n addMenuClass: (className: string) => {\n this.menuElement.classList.add(className);\n },\n removeMenuClass: (className: string) => {\n this.menuElement.classList.remove(className);\n },\n openMenu: () => {\n this.menu.open = true;\n },\n closeMenu: () => {\n this.menu.open = false;\n },\n getAnchorElement: () =>\n this.root.querySelector<HTMLElement>(strings.SELECT_ANCHOR_SELECTOR)!,\n setMenuAnchorElement: (anchorEl: HTMLElement) => {\n this.menu.setAnchorElement(anchorEl);\n },\n setMenuAnchorCorner: (anchorCorner: menuSurfaceConstants.Corner) => {\n this.menu.setAnchorCorner(anchorCorner);\n },\n setMenuWrapFocus: (wrapFocus: boolean) => {\n this.menu.wrapFocus = wrapFocus;\n },\n getSelectedIndex: () => {\n const index = this.menu.selectedIndex;\n return index instanceof Array ? index[0] : index;\n },\n setSelectedIndex: (index: number) => {\n this.menu.selectedIndex = index;\n },\n focusMenuItemAtIndex: (index: number) => {\n this.menu.items[index]?.focus();\n },\n getMenuItemCount: () => this.menu.items.length,\n // Cache menu item values. layoutOptions() updates this cache.\n getMenuItemValues: () => this.menuItemValues,\n getMenuItemTextAtIndex: (index: number) =>\n this.menu.getPrimaryTextAtIndex(index),\n isTypeaheadInProgress: () => this.menu.typeaheadInProgress,\n typeaheadMatchItem: (nextChar: string, startingIndex: number) =>\n this.menu.typeaheadMatchItem(nextChar, startingIndex),\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) => {\n this.root.classList.add(className);\n },\n removeClass: (className: string) => {\n this.root.classList.remove(className);\n },\n hasClass: (className: string) => this.root.classList.contains(className),\n setRippleCenter: (normalizedX: number) => {\n this.lineRipple && this.lineRipple.setRippleCenter(normalizedX);\n },\n activateBottomLine: () => {\n this.lineRipple && this.lineRipple.activate();\n },\n deactivateBottomLine: () => {\n this.lineRipple && this.lineRipple.deactivate();\n },\n notifyChange: (value: string) => {\n if (this.hiddenInput) {\n this.hiddenInput.value = value;\n }\n\n const index = this.selectedIndex;\n this.emit<MDCSelectEventDetail>(\n 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) => {\n this.outline && this.outline.notch(labelWidth);\n },\n closeOutline: () => {\n this.outline && this.outline.closeNotch();\n },\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) => {\n this.label && this.label.float(shouldFloat);\n },\n getLabelWidth: () => this.label ? this.label.getWidth() : 0,\n setLabelRequired: (isRequired: boolean) => {\n this.label && this.label.setRequired(isRequired);\n },\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n /**\n * Calculates where the line ripple should start based on the x coordinate\n * within the component.\n */\n private getNormalizedXCoordinate(evt: MouseEvent|TouchEvent): number {\n const targetClientRect = (evt.target as Element).getBoundingClientRect();\n const xCoordinate =\n 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.foundationForSelect :\n undefined,\n leadingIcon: this.leadingIcon ? this.leadingIcon.foundationForSelect :\n 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 MENU_INVALID: 'mdc-select__menu--invalid',\n OUTLINED: 'mdc-select--outlined',\n REQUIRED: 'mdc-select--required',\n ROOT: 'mdc-select',\n WITH_LEADING_ICON: 'mdc-select--with-leading-icon',\n};\n\nconst strings = {\n ARIA_CONTROLS: 'aria-controls',\n ARIA_DESCRIBEDBY: 'aria-describedby',\n ARIA_SELECTED_ATTR: 'aria-selected',\n CHANGE_EVENT: 'MDCSelect:change',\n HIDDEN_INPUT_SELECTOR: 'input[type=\"hidden\"]',\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_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 CLICK_DEBOUNCE_TIMEOUT_MS: 330,\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 {KEY, normalizeKey} from '@material/dom/keyboard';\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\n/** MDC Select Foundation */\nexport class MDCSelectFoundation extends MDCFoundation<MDCSelectAdapter> {\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get numbers() {\n return numbers;\n }\n\n static override get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectAdapter} for typing information on parameters and\n * return types.\n */\n static override 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 getSelectedIndex: () => -1,\n setSelectedIndex: () => undefined,\n hasLabel: () => false,\n floatLabel: () => undefined,\n getLabelWidth: () => 0,\n setLabelRequired: () => undefined,\n hasOutline: () => false,\n notchOutline: () => undefined,\n closeOutline: () => undefined,\n setRippleCenter: () => undefined,\n notifyChange: () => undefined,\n setSelectedText: () => undefined,\n isSelectAnchorFocused: () => false,\n getSelectAnchorAttr: () => '',\n setSelectAnchorAttr: () => undefined,\n removeSelectAnchorAttr: () => undefined,\n addMenuClass: () => undefined,\n removeMenuClass: () => undefined,\n openMenu: () => undefined,\n closeMenu: () => undefined,\n getAnchorElement: () => null,\n setMenuAnchorElement: () => undefined,\n setMenuAnchorCorner: () => undefined,\n setMenuWrapFocus: () => undefined,\n focusMenuItemAtIndex: () => undefined,\n getMenuItemCount: () => 0,\n getMenuItemValues: () => [],\n getMenuItemTextAtIndex: () => '',\n isTypeaheadInProgress: () => false,\n typeaheadMatchItem: () => -1,\n };\n // tslint:enable:object-literal-sort-keys\n }\n\n private readonly leadingIcon: MDCSelectIconFoundation|undefined;\n private readonly helperText: MDCSelectHelperTextFoundation|undefined;\n // Client provided `aria-describedby` ids. Does not include helpTextId.\n private readonly ariaDescribedbyIds: string[];\n\n // Disabled state\n private disabled = false;\n // isMenuOpen is used to track the state of the menu by listening to the\n // MDCMenuSurface:closed event For reference, menu.open will return false if\n // the menu is still closing, but isMenuOpen returns false only after the menu\n // has closed\n private isMenuOpen = false;\n // By default, select is invalid if it is required but no value is selected.\n private useDefaultValidation = true;\n private customValidity = true;\n private lastSelectedIndex = numbers.UNSET_INDEX;\n\n private clickDebounceTimeout = 0;\n private recentlyClicked = 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(\n adapter?: Partial<MDCSelectAdapter>,\n foundationMap: Partial<MDCSelectFoundationMap> = {}) {\n super({...MDCSelectFoundation.defaultAdapter, ...adapter});\n\n this.leadingIcon = foundationMap.leadingIcon;\n this.helperText = foundationMap.helperText;\n this.ariaDescribedbyIds =\n this.adapter.getSelectAnchorAttr(strings.ARIA_DESCRIBEDBY)\n ?.split(' ')\n ?.filter(id => id !== this.helperText?.getId() && id !== '') ||\n [];\n }\n\n /** Returns the index of the currently selected menu item, or -1 if none. */\n getSelectedIndex(): number {\n return this.adapter.getSelectedIndex();\n }\n\n setSelectedIndex(index: number, closeMenu = false, skipNotify = false) {\n if (index >= this.adapter.getMenuItemCount()) {\n return;\n }\n\n this.adapter.setSelectedIndex(index);\n\n if (index === numbers.UNSET_INDEX) {\n this.adapter.setSelectedText('');\n } else {\n this.adapter.setSelectedText(\n this.adapter.getMenuItemTextAtIndex(index).trim());\n }\n\n if (closeMenu) {\n this.adapter.closeMenu();\n }\n\n if (!skipNotify && this.lastSelectedIndex !== index) {\n this.handleChange();\n }\n this.lastSelectedIndex = index;\n }\n\n setValue(value: string, skipNotify = false) {\n const index = this.adapter.getMenuItemValues().indexOf(value);\n this.setSelectedIndex(index, /** closeMenu */ false, skipNotify);\n }\n\n getValue() {\n const index = this.adapter.getSelectedIndex();\n const menuItemValues = this.adapter.getMenuItemValues();\n return index !== numbers.UNSET_INDEX ? menuItemValues[index] : '';\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 if (this.disabled) {\n // Prevent click events from focusing select. Simply pointer-events: none\n // is not enough since screenreader clicks may bypass this.\n this.adapter.removeSelectAnchorAttr('tabindex');\n } else {\n this.adapter.setSelectAnchorAttr('tabindex', '0');\n }\n\n this.adapter.setSelectAnchorAttr('aria-disabled', this.disabled.toString());\n }\n\n /** Opens the menu. */\n openMenu() {\n this.adapter.addClass(cssClasses.ACTIVATED);\n this.adapter.openMenu();\n this.isMenuOpen = true;\n this.adapter.setSelectAnchorAttr('aria-expanded', 'true');\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 /**\n * Re-calculates if the notched outline should be notched and if the label\n * should float.\n */\n layout() {\n if (this.adapter.hasLabel()) {\n const optionHasValue = this.getValue().length > 0;\n const isFocused = this.adapter.hasClass(cssClasses.FOCUSED);\n const shouldFloatAndNotch = optionHasValue || isFocused;\n const isRequired = this.adapter.hasClass(cssClasses.REQUIRED);\n\n this.notchOutline(shouldFloatAndNotch);\n this.adapter.floatLabel(shouldFloatAndNotch);\n this.adapter.setLabelRequired(isRequired);\n }\n }\n\n /**\n * Synchronizes the list of options with the state of the foundation. Call\n * this whenever menu options are dynamically updated.\n */\n layoutOptions() {\n const menuItemValues = this.adapter.getMenuItemValues();\n const selectedIndex = menuItemValues.indexOf(this.getValue());\n this.setSelectedIndex(\n selectedIndex, /** closeMenu */ false, /** skipNotify */ true);\n }\n\n handleMenuOpened() {\n if (this.adapter.getMenuItemValues().length === 0) {\n return;\n }\n\n // Menu should open to the last selected element, should open to first menu\n // item otherwise.\n const selectedIndex = this.getSelectedIndex();\n const focusItemIndex = selectedIndex >= 0 ? selectedIndex : 0;\n this.adapter.focusMenuItemAtIndex(focusItemIndex);\n }\n\n handleMenuClosing() {\n this.adapter.setSelectAnchorAttr('aria-expanded', 'false');\n }\n\n handleMenuClosed() {\n this.adapter.removeClass(cssClasses.ACTIVATED);\n this.isMenuOpen = false;\n\n // Unfocus the select if menu is closed without a selection\n if (!this.adapter.isSelectAnchorFocused()) {\n this.blur();\n }\n }\n\n /**\n * Handles value changes, via change event or programmatic updates.\n */\n handleChange() {\n this.layout();\n this.adapter.notifyChange(this.getValue());\n\n const isRequired = this.adapter.hasClass(cssClasses.REQUIRED);\n if (isRequired && this.useDefaultValidation) {\n this.setValid(this.isValid());\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 this.layout();\n\n this.adapter.activateBottomLine();\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.disabled || this.recentlyClicked) {\n return;\n }\n\n this.setClickDebounceTimeout();\n\n if (this.isMenuOpen) {\n this.adapter.closeMenu();\n return;\n }\n\n this.adapter.setRippleCenter(normalizedX);\n\n this.openMenu();\n }\n\n /**\n * Handles keydown events on select element. Depending on the type of\n * character typed, does typeahead matching or opens menu.\n */\n handleKeydown(event: KeyboardEvent) {\n if (this.isMenuOpen || !this.adapter.hasClass(cssClasses.FOCUSED)) {\n return;\n }\n\n const isEnter = normalizeKey(event) === KEY.ENTER;\n const isSpace = normalizeKey(event) === KEY.SPACEBAR;\n const arrowUp = normalizeKey(event) === KEY.ARROW_UP;\n const arrowDown = normalizeKey(event) === KEY.ARROW_DOWN;\n const isModifier = event.ctrlKey || event.metaKey;\n // Typeahead\n if (!isModifier &&\n (!isSpace && event.key && event.key.length === 1 ||\n isSpace && this.adapter.isTypeaheadInProgress())) {\n const key = isSpace ? ' ' : event.key;\n const typeaheadNextIndex =\n this.adapter.typeaheadMatchItem(key, this.getSelectedIndex());\n if (typeaheadNextIndex >= 0) {\n this.setSelectedIndex(typeaheadNextIndex);\n }\n event.preventDefault();\n return;\n }\n\n if (!isEnter && !isSpace && !arrowUp && !arrowDown) {\n return;\n }\n\n this.openMenu();\n event.preventDefault();\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 getUseDefaultValidation(): boolean {\n return this.useDefaultValidation;\n }\n\n setUseDefaultValidation(useDefaultValidation: boolean) {\n this.useDefaultValidation = useDefaultValidation;\n }\n\n setValid(isValid: boolean) {\n if (!this.useDefaultValidation) {\n this.customValidity = isValid;\n }\n\n this.adapter.setSelectAnchorAttr('aria-invalid', (!isValid).toString());\n if (isValid) {\n this.adapter.removeClass(cssClasses.INVALID);\n this.adapter.removeMenuClass(cssClasses.MENU_INVALID);\n } else {\n this.adapter.addClass(cssClasses.INVALID);\n this.adapter.addMenuClass(cssClasses.MENU_INVALID);\n }\n\n this.syncHelperTextValidity(isValid);\n }\n\n isValid() {\n if (this.useDefaultValidation &&\n this.adapter.hasClass(cssClasses.REQUIRED) &&\n !this.adapter.hasClass(cssClasses.DISABLED)) {\n // See notes for required attribute under\n // https://www.w3.org/TR/html52/sec-forms.html#the-select-element TL;DR:\n // Invalid if no index is selected, or if the first index is selected and\n // has an empty value.\n return this.getSelectedIndex() !== numbers.UNSET_INDEX &&\n (this.getSelectedIndex() !== 0 || Boolean(this.getValue()));\n }\n return this.customValidity;\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.setSelectAnchorAttr('aria-required', isRequired.toString());\n this.adapter.setLabelRequired(isRequired);\n }\n\n getRequired() {\n return this.adapter.getSelectAnchorAttr('aria-required') === 'true';\n }\n\n override 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 this.setDisabled(this.adapter.hasClass(cssClasses.DISABLED));\n this.syncHelperTextValidity(!this.adapter.hasClass(cssClasses.INVALID));\n this.layout();\n this.layoutOptions();\n }\n\n /**\n * Unfocuses the select component.\n */\n private blur() {\n this.adapter.removeClass(cssClasses.FOCUSED);\n this.layout();\n this.adapter.deactivateBottomLine();\n\n const isRequired = this.adapter.hasClass(cssClasses.REQUIRED);\n if (isRequired && this.useDefaultValidation) {\n this.setValid(this.isValid());\n }\n }\n\n private syncHelperTextValidity(isValid: boolean) {\n if (!this.helperText) {\n return;\n }\n\n this.helperText.setValidity(isValid);\n\n const helperTextVisible = this.helperText.isVisible();\n const helperTextId = this.helperText.getId();\n\n if (helperTextVisible && helperTextId) {\n this.adapter.setSelectAnchorAttr(\n strings.ARIA_DESCRIBEDBY,\n [...this.ariaDescribedbyIds, helperTextId].join(' '));\n } else {\n // Remove helptext from list of describedby ids. Needed because\n // screenreaders will read labels pointed to by `aria-describedby` even if\n // they are `aria-hidden`.\n if (this.ariaDescribedbyIds.length > 0) {\n this.adapter.setSelectAnchorAttr(\n strings.ARIA_DESCRIBEDBY, this.ariaDescribedbyIds.join(' '));\n } else { // helper text is the only describedby element\n this.adapter.removeSelectAnchorAttr(strings.ARIA_DESCRIBEDBY);\n }\n }\n }\n\n private setClickDebounceTimeout() {\n clearTimeout(this.clickDebounceTimeout);\n this.clickDebounceTimeout = setTimeout(() => {\n this.recentlyClicked = false;\n }, numbers.CLICK_DEBOUNCE_TIMEOUT_MS);\n this.recentlyClicked = 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 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\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCSelectHelperTextAdapter {\n /**\n * Adds a class to the helper text element.\n */\n addClass(className: string): void;\n\n /**\n * Removes a class from the helper text element.\n */\n removeClass(className: string): void;\n\n /**\n * Returns whether or not the helper text element contains the given class.\n */\n hasClass(className: string): boolean;\n\n /**\n * Sets an attribute with a given value on the helper text element.\n */\n setAttr(attr: string, value: string): void;\n\n /**\n * Removes an attribute from the helper text element.\n */\n removeAttr(attr: string): void;\n\n /**\n * Gets an attribute from the helper text element.\n */\n getAttr(attr: string): string|null;\n\n /**\n * Sets the text content for the helper text element.\n */\n setContent(content: string): void;\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';\n\nimport {MDCSelectHelperTextAdapter} from './adapter';\nimport {MDCSelectHelperTextFoundation} from './foundation';\n\n/** MDC Select Helper Text Factory */\nexport type MDCSelectHelperTextFactory =\n (el: HTMLElement, foundation?: MDCSelectHelperTextFoundation) =>\n MDCSelectHelperText;\n\n/** MDC Select Helper Text */\nexport class MDCSelectHelperText extends\n MDCComponent<MDCSelectHelperTextFoundation> {\n static override attachTo(root: HTMLElement): MDCSelectHelperText {\n return new MDCSelectHelperText(root);\n }\n\n // Provided for access by MDCSelect component\n get foundationForSelect(): MDCSelectHelperTextFoundation {\n return this.foundation;\n }\n\n override 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 order as the adapter interface.\n const adapter: MDCSelectHelperTextAdapter = {\n addClass: (className) => {\n this.root.classList.add(className);\n },\n removeClass: (className) => {\n this.root.classList.remove(className);\n },\n hasClass: (className) => this.root.classList.contains(className),\n getAttr: (attr) => this.root.getAttribute(attr),\n setAttr: (attr, value) => {\n this.safeSetAttribute(this.root, attr, value);\n },\n removeAttr: (attr) => {\n this.root.removeAttribute(attr);\n },\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_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg',\n HELPER_TEXT_VALIDATION_MSG_PERSISTENT:\n 'mdc-select-helper-text--validation-msg-persistent',\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';\n\nimport {MDCSelectHelperTextAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\n/** MDC Select Helper Text Foundation */\nexport class MDCSelectHelperTextFoundation extends\n MDCFoundation<MDCSelectHelperTextAdapter> {\n static override get cssClasses() {\n return cssClasses;\n }\n\n static override get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectHelperTextAdapter} for typing information on parameters\n * and return types.\n */\n static override 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 getAttr: () => null,\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 * @return The ID of the helper text, or null if none is set.\n */\n getId(): string|null {\n return this.adapter.getAttr('id');\n }\n\n /**\n * @return Whether the helper text is currently visible.\n */\n isVisible(): boolean {\n return this.adapter.getAttr(strings.ARIA_HIDDEN) !== 'true';\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 helper text to act as a validation message.\n * By default, validation messages are hidden when the select is valid and\n * visible when the select is invalid.\n *\n * @param isValidation True to make the helper text act as an error validation\n * 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 * Sets the persistency of the validation helper text.\n * This keeps the validation message visible even if the select is valid,\n * though it will be displayed in the normal (grey) color.\n */\n setValidationMsgPersistent(isPersistent: boolean) {\n if (isPersistent) {\n this.adapter.addClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n } else {\n this.adapter.removeClass(\n cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n }\n }\n\n /**\n * @return Whether the helper text acts as a validation message.\n * By default, validation messages are hidden when the select is valid and\n * visible when the select is invalid.\n */\n getIsValidation() {\n return this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n }\n\n /**\n * @return Whether the validation helper text persists even if the input is\n * valid. If it is, it will be displayed in the normal (grey) color.\n */\n getIsValidationMsgPersistent() {\n return this.adapter.hasClass(\n cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n }\n\n /**\n * When acting as a validation message, shows/hides the helper text and\n * triggers alerts as necessary based on the select's validity.\n */\n setValidity(selectIsValid: boolean) {\n const isValidationMsg =\n this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG);\n\n if (!isValidationMsg) {\n // Non-validating helper-text is always displayed and does not participate\n // in validation logic.\n return;\n }\n\n const isPersistentValidationMsg =\n this.adapter.hasClass(cssClasses.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);\n\n // Validating helper text is displayed if select is invalid, unless it is\n // set as persistent, in which case it always displays.\n const msgShouldDisplay = !selectIsValid || isPersistentValidationMsg;\n if (msgShouldDisplay) {\n this.showToScreenReader();\n\n // In addition to displaying, also trigger an alert if the select\n // has become invalid.\n if (!selectIsValid) {\n this.adapter.setAttr(strings.ROLE, 'alert');\n } else {\n this.adapter.removeAttr(strings.ROLE);\n }\n return;\n }\n\n // Hide everything.\n this.adapter.removeAttr(strings.ROLE);\n this.hide();\n }\n\n /**\n * Makes the helper text visible to screen readers.\n */\n private showToScreenReader() {\n this.adapter.removeAttr(strings.ARIA_HIDDEN);\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 {EventType, SpecificEventListener} from '@material/base/types';\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCSelectIconAdapter {\n /**\n * Gets the value of an attribute on the icon element.\n */\n getAttr(attr: string): string|null;\n\n /**\n * Sets an attribute on the icon element.\n */\n setAttr(attr: string, value: string): void;\n\n /**\n * Removes an attribute from the icon element.\n */\n removeAttr(attr: string): void;\n\n /**\n * Sets the text content of the icon element.\n */\n setContent(content: string): void;\n\n /**\n * Registers an event listener on the icon element for a given event.\n */\n registerInteractionHandler<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>): void;\n\n /**\n * Deregisters an event listener on the icon element for a given event.\n */\n deregisterInteractionHandler<K extends EventType>(\n evtType: K, handler: SpecificEventListener<K>): void;\n\n /**\n * Emits a custom event \"MDCSelect:icon\" denoting a user has clicked the icon.\n */\n notifyIconAction(): void;\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';\n\nimport {MDCSelectIconAdapter} from './adapter';\nimport {MDCSelectIconFoundation} from './foundation';\n\n/** MDC Select Icon Factory */\nexport type MDCSelectIconFactory =\n (el: HTMLElement, foundation?: MDCSelectIconFoundation) => MDCSelectIcon;\n\n/** MDC Select Icon */\nexport class MDCSelectIcon extends MDCComponent<MDCSelectIconFoundation> {\n static override attachTo(root: HTMLElement): MDCSelectIcon {\n return new MDCSelectIcon(root);\n }\n\n // Provided for access by MDCSelect component\n get foundationForSelect(): MDCSelectIconFoundation {\n return this.foundation;\n }\n\n override 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 order as the adapter interface.\n const adapter: MDCSelectIconAdapter = {\n getAttr: (attr) => this.root.getAttribute(attr),\n setAttr: (attr, value) => {\n this.safeSetAttribute(this.root, attr, value);\n },\n removeAttr: (attr) => {\n this.root.removeAttribute(attr);\n },\n setContent: (content) => {\n this.root.textContent = content;\n },\n registerInteractionHandler: (evtType, handler) => {\n this.listen(evtType, handler);\n },\n deregisterInteractionHandler: (evtType, handler) => {\n this.unlisten(evtType, handler);\n },\n notifyIconAction: () => {\n this.emit(\n MDCSelectIconFoundation.strings.ICON_EVENT, {} /* evtData */,\n true /* shouldBubble */);\n },\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';\n\nimport {MDCSelectIconAdapter} from './adapter';\nimport {strings} from './constants';\n\ntype InteractionEventType = 'click'|'keydown';\n\nconst INTERACTION_EVENTS: InteractionEventType[] = ['click', 'keydown'];\n\n/** MDC Select Icon Foundation */\nexport class MDCSelectIconFoundation extends\n MDCFoundation<MDCSelectIconAdapter> {\n static override get strings() {\n return strings;\n }\n\n /**\n * See {@link MDCSelectIconAdapter} for typing information on parameters and\n * return types.\n */\n static override 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!:\n SpecificEventListener<InteractionEventType>;\n\n constructor(adapter?: Partial<MDCSelectIconAdapter>) {\n super({...MDCSelectIconFoundation.defaultAdapter, ...adapter});\n\n this.interactionHandler = (evt) => {\n this.handleInteraction(evt);\n };\n }\n\n override init() {\n this.savedTabIndex = this.adapter.getAttr('tabindex');\n\n for (const evtType of INTERACTION_EVENTS) {\n this.adapter.registerInteractionHandler(evtType, this.interactionHandler);\n }\n }\n\n override destroy() {\n for (const evtType of INTERACTION_EVENTS) {\n this.adapter.deregisterInteractionHandler(\n 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' ||\n (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 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 {MDCSelectHelperTextFoundation} from './helper-text/foundation';\nimport {MDCSelectIconFoundation} from './icon/foundation';\n\nexport interface MDCSelectFoundationMap {\n leadingIcon: MDCSelectIconFoundation;\n helperText: MDCSelectHelperTextFoundation;\n}\n\nexport interface MDCSelectEventDetail {\n value: string;\n index: number;\n}\n\n// Note: CustomEvent<T> is not supported by Closure Compiler.\n\nexport interface MDCSelectEvent extends Event {\n readonly detail: MDCSelectEventDetail;\n}\n"],"sourceRoot":""}