@avs/go-react 0.12.71731 → 0.12.71739

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/demo/node_modules/.vite/deps/@polymer_iron-resizable-behavior_iron-resizable-behavior__js.js +2321 -0
  2. package/demo/node_modules/.vite/deps/@polymer_iron-resizable-behavior_iron-resizable-behavior__js.js.map +7 -0
  3. package/demo/node_modules/.vite/deps/@polymer_polymer_lib_legacy_class__js.js +13 -0
  4. package/demo/node_modules/.vite/deps/@polymer_polymer_lib_legacy_class__js.js.map +7 -0
  5. package/demo/node_modules/.vite/deps/@polymer_polymer_lib_utils_mixin__js.js +8 -0
  6. package/demo/node_modules/.vite/deps/@polymer_polymer_lib_utils_mixin__js.js.map +7 -0
  7. package/demo/node_modules/.vite/deps/@polymer_polymer_lib_utils_render-status__js.js +12 -0
  8. package/demo/node_modules/.vite/deps/@polymer_polymer_lib_utils_render-status__js.js.map +7 -0
  9. package/demo/node_modules/.vite/deps/@polymer_polymer_polymer-element__js.js +15 -0
  10. package/demo/node_modules/.vite/deps/@polymer_polymer_polymer-element__js.js.map +7 -0
  11. package/demo/node_modules/.vite/deps/_metadata.json +103 -0
  12. package/demo/node_modules/.vite/deps/chunk-6HI7N2AN.js +267 -0
  13. package/demo/node_modules/.vite/deps/chunk-6HI7N2AN.js.map +7 -0
  14. package/demo/node_modules/.vite/deps/chunk-BHAOVVTR.js +4597 -0
  15. package/demo/node_modules/.vite/deps/chunk-BHAOVVTR.js.map +7 -0
  16. package/demo/node_modules/.vite/deps/chunk-BSA4YZO6.js +83 -0
  17. package/demo/node_modules/.vite/deps/chunk-BSA4YZO6.js.map +7 -0
  18. package/demo/node_modules/.vite/deps/chunk-BUSYA2B4.js +8 -0
  19. package/demo/node_modules/.vite/deps/chunk-BUSYA2B4.js.map +7 -0
  20. package/demo/node_modules/.vite/deps/chunk-CWUEONQP.js +991 -0
  21. package/demo/node_modules/.vite/deps/chunk-CWUEONQP.js.map +7 -0
  22. package/demo/node_modules/.vite/deps/chunk-I2HDYNON.js +46 -0
  23. package/demo/node_modules/.vite/deps/chunk-I2HDYNON.js.map +7 -0
  24. package/demo/node_modules/.vite/deps/chunk-MXBCLPIN.js +5 -0
  25. package/demo/node_modules/.vite/deps/chunk-MXBCLPIN.js.map +7 -0
  26. package/demo/node_modules/.vite/deps/chunk-PRUGAEYJ.js +4871 -0
  27. package/demo/node_modules/.vite/deps/chunk-PRUGAEYJ.js.map +7 -0
  28. package/demo/node_modules/.vite/deps/chunk-QQPVW2K2.js +62 -0
  29. package/demo/node_modules/.vite/deps/chunk-QQPVW2K2.js.map +7 -0
  30. package/demo/node_modules/.vite/deps/package.json +3 -0
  31. package/demo/node_modules/.vite/deps/react-dom.js +6 -0
  32. package/demo/node_modules/.vite/deps/react-dom.js.map +7 -0
  33. package/demo/node_modules/.vite/deps/react-dom_client.js +20193 -0
  34. package/demo/node_modules/.vite/deps/react-dom_client.js.map +7 -0
  35. package/demo/node_modules/.vite/deps/react.js +5 -0
  36. package/demo/node_modules/.vite/deps/react.js.map +7 -0
  37. package/demo/node_modules/.vite/deps/react_jsx-dev-runtime.js +265 -0
  38. package/demo/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
  39. package/demo/node_modules/.vite/deps/react_jsx-runtime.js +276 -0
  40. package/demo/node_modules/.vite/deps/react_jsx-runtime.js.map +7 -0
  41. package/demo/node_modules/.vite/deps/three.js +41878 -0
  42. package/demo/node_modules/.vite/deps/three.js.map +7 -0
  43. package/demo/src/App.tsx +26 -5
  44. package/package.json +3 -3
  45. package/src/AvsGoDataViz.jsx +2 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../node_modules/@webcomponents/shadycss/src/style-settings.js", "../../../../../../node_modules/@webcomponents/shadycss/src/css-parse.js", "../../../../../../node_modules/@webcomponents/shadycss/src/common-regex.js", "../../../../../../node_modules/@webcomponents/shadycss/src/unscoped-style-handler.js", "../../../../../../node_modules/@webcomponents/shadycss/src/style-util.js", "../../../../../../node_modules/@webcomponents/shadycss/src/common-utils.js", "../../../../../../node_modules/@webcomponents/shadycss/src/apply-shim.js", "../../../../../../node_modules/@webcomponents/shadycss/src/template-map.js", "../../../../../../node_modules/@webcomponents/shadycss/src/apply-shim-utils.js", "../../../../../../node_modules/@webcomponents/shadycss/src/document-wait.js", "../../../../../../node_modules/@webcomponents/shadycss/src/custom-style-interface.js", "../../../../../../node_modules/@webcomponents/shadycss/entrypoints/apply-shim.js", "../../../../../../node_modules/@polymer/polymer/lib/utils/debounce.js", "../../../../../../node_modules/@polymer/polymer/lib/utils/gestures.js", "../../../../../../node_modules/@polymer/polymer/lib/mixins/gesture-event-listeners.js", "../../../../../../node_modules/@polymer/polymer/lib/mixins/dir-mixin.js", "../../../../../../node_modules/@polymer/polymer/lib/utils/unresolved.js", "../../../../../../node_modules/@polymer/polymer/lib/utils/array-splice.js", "../../../../../../node_modules/@polymer/polymer/lib/utils/flattened-nodes-observer.js", "../../../../../../node_modules/@polymer/polymer/lib/utils/flush.js", "../../../../../../node_modules/@polymer/polymer/lib/legacy/polymer.dom.js", "../../../../../../node_modules/@polymer/polymer/lib/utils/scope-subtree.js", "../../../../../../node_modules/@polymer/polymer/lib/mixins/disable-upgrade-mixin.js", "../../../../../../node_modules/@polymer/polymer/lib/legacy/legacy-element-mixin.js", "../../../../../../node_modules/@polymer/polymer/lib/legacy/class.js"],
4
+ "sourcesContent": ["/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport const nativeShadow = !(window['ShadyDOM'] && window['ShadyDOM']['inUse']);\nlet nativeCssVariables_;\n\n/**\n * @param {(ShadyCSSOptions | ShadyCSSInterface)=} settings\n */\nfunction calcCssVariables(settings) {\n if (settings && settings['shimcssproperties']) {\n nativeCssVariables_ = false;\n } else {\n // chrome 49 has semi-working css vars, check if box-shadow works\n // safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\n // However, shim css custom properties are only supported with ShadyDOM enabled,\n // so fall back on native if we do not detect ShadyDOM\n // Edge 15: custom properties used in ::before and ::after will also be used in the parent element\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12414257/\n nativeCssVariables_ = nativeShadow || Boolean(!navigator.userAgent.match(/AppleWebKit\\/601|Edge\\/15/) &&\n window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n }\n}\n\n/** @type {string | undefined} */\nexport let cssBuild;\nif (window.ShadyCSS && window.ShadyCSS.cssBuild !== undefined) {\n cssBuild = window.ShadyCSS.cssBuild;\n}\n\n/** @type {boolean} */\nexport const disableRuntime = Boolean(window.ShadyCSS && window.ShadyCSS.disableRuntime);\n\nif (window.ShadyCSS && window.ShadyCSS.nativeCss !== undefined) {\n nativeCssVariables_ = window.ShadyCSS.nativeCss;\n} else if (window.ShadyCSS) {\n calcCssVariables(window.ShadyCSS);\n // reset window variable to let ShadyCSS API take its place\n window.ShadyCSS = undefined;\n} else {\n calcCssVariables(window['WebComponents'] && window['WebComponents']['flags']);\n}\n\n// Hack for type error under new type inference which doesn't like that\n// nativeCssVariables is updated in a function and assigns the type\n// `function(): ?` instead of `boolean`.\nexport const nativeCssVariables = /** @type {boolean} */(nativeCssVariables_);", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n/** @unrestricted */\nclass StyleNode {\n constructor() {\n /** @type {number} */\n this['start'] = 0;\n /** @type {number} */\n this['end'] = 0;\n /** @type {StyleNode} */\n this['previous'] = null;\n /** @type {StyleNode} */\n this['parent'] = null;\n /** @type {Array<StyleNode>} */\n this['rules'] = null;\n /** @type {string} */\n this['parsedCssText'] = '';\n /** @type {string} */\n this['cssText'] = '';\n /** @type {boolean} */\n this['atRule'] = false;\n /** @type {number} */\n this['type'] = 0;\n /** @type {string} */\n this['keyframesName'] = '';\n /** @type {string} */\n this['selector'] = '';\n /** @type {string} */\n this['parsedSelector'] = '';\n }\n}\n\nexport {StyleNode}\n\n// given a string of css, return a simple rule tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\n/**\n * @param {string} text\n * @return {!StyleNode}\n */\nfunction lex(text) {\n let root = new StyleNode();\n root['start'] = 0;\n root['end'] = text.length\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n['rules']) {\n n['rules'] = [];\n }\n let p = n;\n let previous = p['rules'][p['rules'].length - 1] || null;\n n = new StyleNode();\n n['start'] = i + 1;\n n['parent'] = p;\n n['previous'] = previous;\n p['rules'].push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n['end'] = i + 1;\n n = n['parent'] || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\n/**\n * @param {StyleNode} node\n * @param {string} text\n * @return {!StyleNode}\n */\nfunction parseCss(node, text) {\n let t = text.substring(node['start'], node['end'] - 1);\n node['parsedCssText'] = node['cssText'] = t.trim();\n if (node['parent']) {\n let ss = node['previous'] ? node['previous']['end'] : node['parent']['start'];\n t = text.substring(ss, node['start'] - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node['parsedSelector'] = node['selector'] = t.trim();\n node['atRule'] = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node['atRule']) {\n if (s.indexOf(MEDIA_START) === 0) {\n node['type'] = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node['type'] = types.KEYFRAMES_RULE;\n node['keyframesName'] =\n node['selector'].split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node['type'] = types.MIXIN_RULE;\n } else {\n node['type'] = types.STYLE_RULE;\n }\n }\n }\n let r$ = node['rules'];\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n/**\n * conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n * expanded form that doesn't require trailing space `\\000033`\n * @param {string} s\n * @return {string}\n */\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n/**\n * stringify parsed css.\n * @param {StyleNode} node\n * @param {boolean=} preserveProperties\n * @param {string=} text\n * @return {string}\n */\nexport function stringify(node, preserveProperties, text = '') {\n // calc rule cssText\n let cssText = '';\n if (node['cssText'] || node['rules']) {\n let r$ = node['rules'];\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node['cssText'] :\n removeCustomProps(node['cssText']);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node['selector']) {\n text += node['selector'] + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node['selector']) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\n/**\n * @param {Array<StyleNode>} rules\n * @return {boolean}\n */\nfunction _hasMixinRules(rules) {\n let r = rules[0];\n return Boolean(r) && Boolean(r['selector']) && r['selector'].indexOf(VAR_START) === 0;\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nexport function removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\n/** @enum {number} */\nexport const types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n}\n\nconst OPEN_BRACE = '{';\nconst CLOSE_BRACE = '}';\n\n// helper regexp's\nconst RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n}\n\nconst VAR_START = '--';\nconst MEDIA_START = '@media';\nconst AT_START = '@';\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nexport const VAR_ASSIGN = /(?:^|[;\\s{]\\s*)(--[\\w-]*?)\\s*:\\s*(?:((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};{])+)|\\{([^}]*)\\}(?:(?=[;\\s}])|$))/gi;\nexport const MIXIN_MATCH = /(?:^|\\W+)@apply\\s*\\(?([^);\\n]*)\\)?/gi;\nexport const VAR_CONSUMED = /(--[\\w-]+)\\s*([:,;)]|$)/gi;\nexport const ANIMATION_MATCH = /(animation\\s*:)|(animation-name\\s*:)/;\nexport const MEDIA_MATCH = /@media\\s(.*)/;\nexport const IS_VAR = /^--/;\nexport const BRACKETED = /\\{[^}]*\\}/g;\nexport const HOST_PREFIX = '(?:^|[^.#[:])';\nexport const HOST_SUFFIX = '($|[.:[\\\\s>+~])';\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/** @type {!Set<string>} */\nconst styleTextSet = new Set();\n\nexport const scopingAttribute = 'shady-unscoped';\n\n/**\n * Add a specifically-marked style to the document directly, and only one copy of that style.\n *\n * @param {!HTMLStyleElement} style\n * @return {undefined}\n */\nexport function processUnscopedStyle(style) {\n const text = style.textContent;\n if (!styleTextSet.has(text)) {\n styleTextSet.add(text);\n const newStyle = document.createElement('style');\n newStyle.setAttribute('shady-unscoped', '');\n newStyle.textContent = text;\n document.head.appendChild(newStyle);\n }\n}\n\n/**\n * Check if a style is supposed to be unscoped\n * @param {!HTMLStyleElement} style\n * @return {boolean} true if the style has the unscoping attribute\n */\nexport function isUnscopedStyle(style) {\n return style.hasAttribute(scopingAttribute);\n}", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables, cssBuild} from './style-settings.js';\nimport {parse, stringify, types, StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\nimport {MEDIA_MATCH} from './common-regex.js';\nimport {processUnscopedStyle, isUnscopedStyle} from './unscoped-style-handler.js';\n\n/**\n * @param {string|StyleNode} rules\n * @param {function(StyleNode)=} callback\n * @return {string}\n */\nexport function toCssText (rules, callback) {\n if (!rules) {\n return '';\n }\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @return {StyleNode}\n */\nexport function rulesForStyle(style) {\n if (!style['__cssRules'] && style.textContent) {\n style['__cssRules'] = parse(style.textContent);\n }\n return style['__cssRules'] || null;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\n/**\n * @param {StyleNode} rule\n * @return {boolean}\n */\nexport function isKeyframesSelector(rule) {\n return Boolean(rule['parent']) &&\n rule['parent']['type'] === types.KEYFRAMES_RULE;\n}\n\n/**\n * @param {StyleNode} node\n * @param {Function=} styleRuleCallback\n * @param {Function=} keyframesRuleCallback\n * @param {boolean=} onlyActiveRules\n */\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n let type = node['type'];\n if (onlyActiveRules) {\n if (type === types.MEDIA_RULE) {\n let matchMedia = node['selector'].match(MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node['rules'];\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i<l) && (r=r$[i]); i++) {\n forEachRule(r, styleRuleCallback, keyframesRuleCallback, onlyActiveRules);\n }\n }\n}\n\n// add a string of cssText to the document.\n/**\n * @param {string} cssText\n * @param {string} moniker\n * @param {Node} target\n * @param {Node} contextNode\n * @return {HTMLStyleElement}\n */\nexport function applyCss(cssText, moniker, target, contextNode) {\n let style = createScopeStyle(cssText, moniker);\n applyStyle(style, target, contextNode);\n return style;\n}\n\n/**\n * @param {string} cssText\n * @param {string} moniker\n * @return {!HTMLStyleElement}\n */\nexport function createScopeStyle(cssText, moniker) {\n let style = /** @type {HTMLStyleElement} */(document.createElement('style'));\n if (moniker) {\n style.setAttribute('scope', moniker);\n }\n style.textContent = cssText;\n return style;\n}\n\n/**\n * Track the position of the last added style for placing placeholders\n * @type {Node}\n */\nlet lastHeadApplyNode = null;\n\n// insert a comment node as a styling position placeholder.\n/**\n * @param {string} moniker\n * @return {!Comment}\n */\nexport function applyStylePlaceHolder(moniker) {\n let placeHolder = document.createComment(' Shady DOM styles for ' +\n moniker + ' ');\n let after = lastHeadApplyNode ?\n lastHeadApplyNode['nextSibling'] : null;\n let scope = document.head;\n scope.insertBefore(placeHolder, after || scope.firstChild);\n lastHeadApplyNode = placeHolder;\n return placeHolder;\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @param {?Node} target\n * @param {?Node} contextNode\n */\nexport function applyStyle(style, target, contextNode) {\n target = target || document.head;\n let after = (contextNode && contextNode.nextSibling) ||\n target.firstChild;\n target.insertBefore(style, after);\n if (!lastHeadApplyNode) {\n lastHeadApplyNode = style;\n } else {\n // only update lastHeadApplyNode if the new style is inserted after the old lastHeadApplyNode\n let position = style.compareDocumentPosition(lastHeadApplyNode);\n if (position === Node.DOCUMENT_POSITION_PRECEDING) {\n lastHeadApplyNode = style;\n }\n }\n}\n\n/**\n * @param {string} buildType\n * @return {boolean}\n */\nexport function isTargetedBuild(buildType) {\n return nativeShadow ? buildType === 'shadow' : buildType === 'shady';\n}\n\n/**\n * Walk from text[start] matching parens and\n * returns position of the outer end paren\n * @param {string} text\n * @param {number} start\n * @return {number}\n */\nexport function findMatchingParen(text, start) {\n let level = 0;\n for (let i=start, l=text.length; i < l; i++) {\n if (text[i] === '(') {\n level++;\n } else if (text[i] === ')') {\n if (--level === 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\n/**\n * @param {string} str\n * @param {function(string, string, string, string)} callback\n */\nexport function processVariableAndFallback(str, callback) {\n // find 'var('\n let start = str.indexOf('var(');\n if (start === -1) {\n // no var?, everything is prefix\n return callback(str, '', '', '');\n }\n //${prefix}var(${inner})${suffix}\n let end = findMatchingParen(str, start + 3);\n let inner = str.substring(start + 4, end);\n let prefix = str.substring(0, start);\n // suffix may have other variables\n let suffix = processVariableAndFallback(str.substring(end + 1), callback);\n let comma = inner.indexOf(',');\n // value and fallback args should be trimmed to match in property lookup\n if (comma === -1) {\n // variable, no fallback\n return callback(prefix, inner.trim(), '', suffix);\n }\n // var(${value},${fallback})\n let value = inner.substring(0, comma).trim();\n let fallback = inner.substring(comma + 1).trim();\n return callback(prefix, value, fallback, suffix);\n}\n\n/**\n * @param {Element} element\n * @param {string} value\n */\nexport function setElementClassRaw(element, value) {\n // use native setAttribute provided by ShadyDOM when setAttribute is patched\n if (nativeShadow) {\n element.setAttribute('class', value);\n } else {\n window['ShadyDOM']['nativeMethods']['setAttribute'].call(element, 'class', value);\n }\n}\n\n/**\n * @type {function(*):*}\n */\nexport const wrap = window['ShadyDOM'] && window['ShadyDOM']['wrap'] || ((node) => node);\n\n/**\n * @param {Element | {is: string, extends: string}} element\n * @return {{is: string, typeExtension: string}}\n */\nexport function getIsExtends(element) {\n let localName = element['localName'];\n let is = '', typeExtension = '';\n /*\n NOTE: technically, this can be wrong for certain svg elements\n with `-` in the name like `<font-face>`\n */\n if (localName) {\n if (localName.indexOf('-') > -1) {\n is = localName;\n } else {\n typeExtension = localName;\n is = (element.getAttribute && element.getAttribute('is')) || '';\n }\n } else {\n is = /** @type {?} */(element).is;\n typeExtension = /** @type {?} */(element).extends;\n }\n return {is, typeExtension};\n}\n\n/**\n * @param {Element|DocumentFragment} element\n * @return {string}\n */\nexport function gatherStyleText(element) {\n /** @type {!Array<string>} */\n const styleTextParts = [];\n const styles = /** @type {!NodeList<!HTMLStyleElement>} */(element.querySelectorAll('style'));\n for (let i = 0; i < styles.length; i++) {\n const style = styles[i];\n if (isUnscopedStyle(style)) {\n if (!nativeShadow) {\n processUnscopedStyle(style);\n style.parentNode.removeChild(style);\n }\n } else {\n styleTextParts.push(style.textContent);\n style.parentNode.removeChild(style);\n }\n }\n return styleTextParts.join('').trim();\n}\n\n/**\n * Split a selector separated by commas into an array in a smart way\n * @param {string} selector\n * @return {!Array<string>}\n */\nexport function splitSelectorList(selector) {\n const parts = [];\n let part = '';\n for (let i = 0; i >= 0 && i < selector.length; i++) {\n // A selector with parentheses will be one complete part\n if (selector[i] === '(') {\n // find the matching paren\n const end = findMatchingParen(selector, i);\n // push the paren block into the part\n part += selector.slice(i, end + 1);\n // move the index to after the paren block\n i = end;\n } else if (selector[i] === ',') {\n parts.push(part);\n part = '';\n } else {\n part += selector[i];\n }\n }\n // catch any pieces after the last comma\n if (part) {\n parts.push(part);\n }\n return parts;\n}\n\nconst CSS_BUILD_ATTR = 'css-build';\n\n/**\n * Return the polymer-css-build \"build type\" applied to this element\n *\n * @param {!HTMLElement} element\n * @return {string} Can be \"\", \"shady\", or \"shadow\"\n */\nexport function getCssBuild(element) {\n if (cssBuild !== undefined) {\n return /** @type {string} */(cssBuild);\n }\n if (element.__cssBuild === undefined) {\n // try attribute first, as it is the common case\n const attrValue = element.getAttribute(CSS_BUILD_ATTR);\n if (attrValue) {\n element.__cssBuild = attrValue;\n } else {\n const buildComment = getBuildComment(element);\n if (buildComment !== '') {\n // remove build comment so it is not needlessly copied into every element instance\n removeBuildComment(element);\n }\n element.__cssBuild = buildComment;\n }\n }\n return element.__cssBuild || '';\n}\n\n/**\n * Check if the given element, either a <template> or <style>, has been processed\n * by polymer-css-build.\n *\n * If so, then we can make a number of optimizations:\n * - polymer-css-build will decompose mixins into individual CSS Custom Properties,\n * so the ApplyShim can be skipped entirely.\n * - Under native ShadowDOM, the style text can just be copied into each instance\n * without modification\n * - If the build is \"shady\" and ShadyDOM is in use, the styling does not need\n * scoping beyond the shimming of CSS Custom Properties\n *\n * @param {!HTMLElement} element\n * @return {boolean}\n */\nexport function elementHasBuiltCss(element) {\n return getCssBuild(element) !== '';\n}\n\n/**\n * For templates made with tagged template literals, polymer-css-build will\n * insert a comment of the form `<!--css-build:shadow-->`\n *\n * @param {!HTMLElement} element\n * @return {string}\n */\nexport function getBuildComment(element) {\n const buildComment = element.localName === 'template' ?\n /** @type {!HTMLTemplateElement} */ (element).content.firstChild :\n element.firstChild;\n if (buildComment instanceof Comment) {\n const commentParts = buildComment.textContent.trim().split(':');\n if (commentParts[0] === CSS_BUILD_ATTR) {\n return commentParts[1];\n }\n }\n return '';\n}\n\n/**\n * Check if the css build status is optimal, and do no unneeded work.\n *\n * @param {string=} cssBuild CSS build status\n * @return {boolean} css build is optimal or not\n */\nexport function isOptimalCssBuild(cssBuild = '') {\n // CSS custom property shim always requires work\n if (cssBuild === '' || !nativeCssVariables) {\n return false;\n }\n return nativeShadow ? cssBuild === 'shadow' : cssBuild === 'shady';\n}\n\n/**\n * @param {!HTMLElement} element\n */\nfunction removeBuildComment(element) {\n const buildComment = element.localName === 'template' ?\n /** @type {!HTMLTemplateElement} */ (element).content.firstChild :\n element.firstChild;\n buildComment.parentNode.removeChild(buildComment);\n}\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport { MIXIN_MATCH, VAR_ASSIGN } from './common-regex.js';\n\n/**\n * @param {Element} element\n * @param {Object=} properties\n */\nexport function updateNativeProperties(element, properties) {\n // remove previous properties\n for (let p in properties) {\n // NOTE: for bc with shim, don't apply null values.\n if (p === null) {\n element.style.removeProperty(p);\n } else {\n element.style.setProperty(p, properties[p]);\n }\n }\n}\n\n/**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\nexport function getComputedStyleValue(element, property) {\n /**\n * @const {string}\n */\n const value = window.getComputedStyle(element).getPropertyValue(property);\n if (!value) {\n return '';\n } else {\n return value.trim();\n }\n}\n\n/**\n * return true if `cssText` contains a mixin definition or consumption\n * @param {string} cssText\n * @return {boolean}\n */\nexport function detectMixin(cssText) {\n const has = MIXIN_MATCH.test(cssText) || VAR_ASSIGN.test(cssText);\n // reset state of the regexes\n MIXIN_MATCH.lastIndex = 0;\n VAR_ASSIGN.lastIndex = 0;\n return has;\n}\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n/*\n * The apply shim simulates the behavior of `@apply` proposed at\n * https://tabatkins.github.io/specs/css-apply-rule/.\n * The approach is to convert a property like this:\n *\n * --foo: {color: red; background: blue;}\n *\n * to this:\n *\n * --foo_-_color: red;\n * --foo_-_background: blue;\n *\n * Then where `@apply --foo` is used, that is converted to:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background);\n *\n * This approach generally works but there are some issues and limitations.\n * Consider, for example, that somewhere *between* where `--foo` is set and used,\n * another element sets it to:\n *\n * --foo: { border: 2px solid red; }\n *\n * We must now ensure that the color and background from the previous setting\n * do not apply. This is accomplished by changing the property set to this:\n *\n * --foo_-_border: 2px solid red;\n * --foo_-_color: initial;\n * --foo_-_background: initial;\n *\n * This works but introduces one new issue.\n * Consider this setup at the point where the `@apply` is used:\n *\n * background: orange;\n * `@apply` --foo;\n *\n * In this case the background will be unset (initial) rather than the desired\n * `orange`. We address this by altering the property set to use a fallback\n * value like this:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background, orange);\n * border: var(--foo_-_border);\n *\n * Note that the default is retained in the property set and the `background` is\n * the desired `orange`. This leads us to a limitation.\n *\n * Limitation 1:\n\n * Only properties in the rule where the `@apply`\n * is used are considered as default values.\n * If another rule matches the element and sets `background` with\n * less specificity than the rule in which `@apply` appears,\n * the `background` will not be set.\n *\n * Limitation 2:\n *\n * When using Polymer's `updateStyles` api, new properties may not be set for\n * `@apply` properties.\n\n*/\n\n'use strict';\n\nimport {forEachRule, processVariableAndFallback, rulesForStyle, toCssText, gatherStyleText} from './style-util.js';\nimport {MIXIN_MATCH, VAR_ASSIGN} from './common-regex.js';\nimport {detectMixin} from './common-utils.js';\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\n\nconst APPLY_NAME_CLEAN = /;\\s*/m;\nconst INITIAL_INHERIT = /^\\s*(initial)|(inherit)\\s*$/;\nconst IMPORTANT = /\\s*!important/;\n\n// separator used between mixin-name and mixin-property-name when producing properties\n// NOTE: plain '-' may cause collisions in user styles\nconst MIXIN_VAR_SEP = '_-_';\n\n/**\n * @typedef {!Object<string, string>}\n */\nlet PropertyEntry; // eslint-disable-line no-unused-vars\n\n/**\n * @typedef {!Object<string, boolean>}\n */\nlet DependantsEntry; // eslint-disable-line no-unused-vars\n\n/** @typedef {{\n * properties: PropertyEntry,\n * dependants: DependantsEntry\n * }}\n */\nlet MixinMapEntry; // eslint-disable-line no-unused-vars\n\n// map of mixin to property names\n// --foo: {border: 2px} -> {properties: {(--foo, ['border'])}, dependants: {'element-name': proto}}\nclass MixinMap {\n constructor() {\n /** @type {!Object<string, !MixinMapEntry>} */\n this._map = {};\n }\n /**\n * @param {string} name\n * @param {!PropertyEntry} props\n */\n set(name, props) {\n name = name.trim();\n this._map[name] = {\n properties: props,\n dependants: {}\n }\n }\n /**\n * @param {string} name\n * @return {MixinMapEntry}\n */\n get(name) {\n name = name.trim();\n return this._map[name] || null;\n }\n}\n\n/**\n * Callback for when an element is marked invalid\n * @type {?function(string)}\n */\nlet invalidCallback = null;\n\n/** @unrestricted */\nclass ApplyShim {\n constructor() {\n /** @type {?string} */\n this._currentElement = null;\n /** @type {HTMLMetaElement} */\n this._measureElement = null;\n this._map = new MixinMap();\n }\n /**\n * return true if `cssText` contains a mixin definition or consumption\n * @param {string} cssText\n * @return {boolean}\n */\n detectMixin(cssText) {\n return detectMixin(cssText);\n }\n\n /**\n * Gather styles into one style for easier processing\n * @param {!HTMLTemplateElement} template\n * @return {HTMLStyleElement}\n */\n gatherStyles(template) {\n const styleText = gatherStyleText(template.content);\n if (styleText) {\n const style = /** @type {!HTMLStyleElement} */(document.createElement('style'));\n style.textContent = styleText;\n template.content.insertBefore(style, template.content.firstChild);\n return style;\n }\n return null;\n }\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @return {StyleNode}\n */\n transformTemplate(template, elementName) {\n if (template._gatheredStyle === undefined) {\n template._gatheredStyle = this.gatherStyles(template);\n }\n /** @type {HTMLStyleElement} */\n const style = template._gatheredStyle;\n return style ? this.transformStyle(style, elementName) : null;\n }\n /**\n * @param {!HTMLStyleElement} style\n * @param {string} elementName\n * @return {StyleNode}\n */\n transformStyle(style, elementName = '') {\n let ast = rulesForStyle(style);\n this.transformRules(ast, elementName);\n style.textContent = toCssText(ast);\n return ast;\n }\n /**\n * @param {!HTMLStyleElement} style\n * @return {StyleNode}\n */\n transformCustomStyle(style) {\n let ast = rulesForStyle(style);\n forEachRule(ast, (rule) => {\n if (rule['selector'] === ':root') {\n rule['selector'] = 'html';\n }\n this.transformRule(rule);\n })\n style.textContent = toCssText(ast);\n return ast;\n }\n /**\n * @param {StyleNode} rules\n * @param {string} elementName\n */\n transformRules(rules, elementName) {\n this._currentElement = elementName;\n forEachRule(rules, (r) => {\n this.transformRule(r);\n });\n this._currentElement = null;\n }\n /**\n * @param {!StyleNode} rule\n */\n transformRule(rule) {\n rule['cssText'] = this.transformCssText(rule['parsedCssText'], rule);\n // :root was only used for variable assignment in property shim,\n // but generates invalid selectors with real properties.\n // replace with `:host > *`, which serves the same effect\n if (rule['selector'] === ':root') {\n rule['selector'] = ':host > *';\n }\n }\n /**\n * @param {string} cssText\n * @param {!StyleNode} rule\n * @return {string}\n */\n transformCssText(cssText, rule) {\n // produce variables\n cssText = cssText.replace(VAR_ASSIGN, (matchText, propertyName, valueProperty, valueMixin) =>\n this._produceCssProperties(matchText, propertyName, valueProperty, valueMixin, rule));\n // consume mixins\n return this._consumeCssProperties(cssText, rule);\n }\n /**\n * @param {string} property\n * @return {string}\n */\n _getInitialValueForProperty(property) {\n if (!this._measureElement) {\n this._measureElement = /** @type {HTMLMetaElement} */(document.createElement('meta'));\n this._measureElement.setAttribute('apply-shim-measure', '');\n this._measureElement.style.all = 'initial';\n document.head.appendChild(this._measureElement);\n }\n return window.getComputedStyle(this._measureElement).getPropertyValue(property);\n }\n /**\n * Walk over all rules before this rule to find fallbacks for mixins\n *\n * @param {!StyleNode} startRule\n * @return {!Object}\n */\n _fallbacksFromPreviousRules(startRule) {\n // find the \"top\" rule\n let topRule = startRule;\n while (topRule['parent']) {\n topRule = topRule['parent'];\n }\n const fallbacks = {};\n let seenStartRule = false;\n forEachRule(topRule, (r) => {\n // stop when we hit the input rule\n seenStartRule = seenStartRule || r === startRule;\n if (seenStartRule) {\n return;\n }\n // NOTE: Only matching selectors are \"safe\" for this fallback processing\n // It would be prohibitive to run `matchesSelector()` on each selector,\n // so we cheat and only check if the same selector string is used, which\n // guarantees things like specificity matching\n if (r['selector'] === startRule['selector']) {\n Object.assign(fallbacks, this._cssTextToMap(r['parsedCssText']));\n }\n });\n return fallbacks;\n }\n /**\n * replace mixin consumption with variable consumption\n * @param {string} text\n * @param {!StyleNode=} rule\n * @return {string}\n */\n _consumeCssProperties(text, rule) {\n /** @type {Array} */\n let m = null;\n // loop over text until all mixins with defintions have been applied\n while((m = MIXIN_MATCH.exec(text))) {\n let matchText = m[0];\n let mixinName = m[1];\n let idx = m.index;\n // collect properties before apply to be \"defaults\" if mixin might override them\n // match includes a \"prefix\", so find the start and end positions of @apply\n let applyPos = idx + matchText.indexOf('@apply');\n let afterApplyPos = idx + matchText.length;\n // find props defined before this @apply\n let textBeforeApply = text.slice(0, applyPos);\n let textAfterApply = text.slice(afterApplyPos);\n let defaults = rule ? this._fallbacksFromPreviousRules(rule) : {};\n Object.assign(defaults, this._cssTextToMap(textBeforeApply));\n let replacement = this._atApplyToCssProperties(mixinName, defaults);\n // use regex match position to replace mixin, keep linear processing time\n text = `${textBeforeApply}${replacement}${textAfterApply}`;\n // move regex search to _after_ replacement\n MIXIN_MATCH.lastIndex = idx + replacement.length;\n }\n return text;\n }\n /**\n * produce variable consumption at the site of mixin consumption\n * `@apply` --foo; -> for all props (${propname}: var(--foo_-_${propname}, ${fallback[propname]}}))\n * Example:\n * border: var(--foo_-_border); padding: var(--foo_-_padding, 2px)\n *\n * @param {string} mixinName\n * @param {Object} fallbacks\n * @return {string}\n */\n _atApplyToCssProperties(mixinName, fallbacks) {\n mixinName = mixinName.replace(APPLY_NAME_CLEAN, '');\n let vars = [];\n let mixinEntry = this._map.get(mixinName);\n // if we depend on a mixin before it is created\n // make a sentinel entry in the map to add this element as a dependency for when it is defined.\n if (!mixinEntry) {\n this._map.set(mixinName, {});\n mixinEntry = this._map.get(mixinName);\n }\n if (mixinEntry) {\n if (this._currentElement) {\n mixinEntry.dependants[this._currentElement] = true;\n }\n let p, parts, f;\n const properties = mixinEntry.properties;\n for (p in properties) {\n f = fallbacks && fallbacks[p];\n parts = [p, ': var(', mixinName, MIXIN_VAR_SEP, p];\n if (f) {\n parts.push(',', f.replace(IMPORTANT, ''));\n }\n parts.push(')');\n if (IMPORTANT.test(properties[p])) {\n parts.push(' !important');\n }\n vars.push(parts.join(''));\n }\n }\n return vars.join('; ');\n }\n\n /**\n * @param {string} property\n * @param {string} value\n * @return {string}\n */\n _replaceInitialOrInherit(property, value) {\n let match = INITIAL_INHERIT.exec(value);\n if (match) {\n if (match[1]) {\n // initial\n // replace `initial` with the concrete initial value for this property\n value = this._getInitialValueForProperty(property);\n } else {\n // inherit\n // with this purposfully illegal value, the variable will be invalid at\n // compute time (https://www.w3.org/TR/css-variables/#invalid-at-computed-value-time)\n // and for inheriting values, will behave similarly\n // we cannot support the same behavior for non inheriting values like 'border'\n value = 'apply-shim-inherit';\n }\n }\n return value;\n }\n\n /**\n * \"parse\" a mixin definition into a map of properties and values\n * cssTextToMap('border: 2px solid black') -> ('border', '2px solid black')\n * @param {string} text\n * @param {boolean=} replaceInitialOrInherit\n * @return {!Object<string, string>}\n */\n _cssTextToMap(text, replaceInitialOrInherit = false) {\n let props = text.split(';');\n let property, value;\n let out = {};\n for (let i = 0, p, sp; i < props.length; i++) {\n p = props[i];\n if (p) {\n sp = p.split(':');\n // ignore lines that aren't definitions like @media\n if (sp.length > 1) {\n property = sp[0].trim();\n // some properties may have ':' in the value, like data urls\n value = sp.slice(1).join(':');\n if (replaceInitialOrInherit) {\n value = this._replaceInitialOrInherit(property, value);\n }\n out[property] = value;\n }\n }\n }\n return out;\n }\n\n /**\n * @param {MixinMapEntry} mixinEntry\n */\n _invalidateMixinEntry(mixinEntry) {\n if (!invalidCallback) {\n return;\n }\n for (let elementName in mixinEntry.dependants) {\n if (elementName !== this._currentElement) {\n invalidCallback(elementName);\n }\n }\n }\n\n /**\n * @param {string} matchText\n * @param {string} propertyName\n * @param {?string} valueProperty\n * @param {?string} valueMixin\n * @param {!StyleNode} rule\n * @return {string}\n */\n _produceCssProperties(matchText, propertyName, valueProperty, valueMixin, rule) {\n // handle case where property value is a mixin\n if (valueProperty) {\n // form: --mixin2: var(--mixin1), where --mixin1 is in the map\n processVariableAndFallback(valueProperty, (prefix, value) => {\n if (value && this._map.get(value)) {\n valueMixin = `@apply ${value};`\n }\n });\n }\n if (!valueMixin) {\n return matchText;\n }\n let mixinAsProperties = this._consumeCssProperties('' + valueMixin, rule);\n let prefix = matchText.slice(0, matchText.indexOf('--'));\n // `initial` and `inherit` as properties in a map should be replaced because\n // these keywords are eagerly evaluated when the mixin becomes CSS Custom Properties,\n // and would set the variable value, rather than carry the keyword to the `var()` usage.\n let mixinValues = this._cssTextToMap(mixinAsProperties, true);\n let combinedProps = mixinValues;\n let mixinEntry = this._map.get(propertyName);\n let oldProps = mixinEntry && mixinEntry.properties;\n if (oldProps) {\n // NOTE: since we use mixin, the map of properties is updated here\n // and this is what we want.\n combinedProps = Object.assign(Object.create(oldProps), mixinValues);\n } else {\n this._map.set(propertyName, combinedProps);\n }\n let out = [];\n let p, v;\n // set variables defined by current mixin\n let needToInvalidate = false;\n for (p in combinedProps) {\n v = mixinValues[p];\n // if property not defined by current mixin, set initial\n if (v === undefined) {\n v = 'initial';\n }\n if (oldProps && !(p in oldProps)) {\n needToInvalidate = true;\n }\n out.push(`${propertyName}${MIXIN_VAR_SEP}${p}: ${v}`);\n }\n if (needToInvalidate) {\n this._invalidateMixinEntry(mixinEntry);\n }\n if (mixinEntry) {\n mixinEntry.properties = combinedProps;\n }\n // because the mixinMap is global, the mixin might conflict with\n // a different scope's simple variable definition:\n // Example:\n // some style somewhere:\n // --mixin1:{ ... }\n // --mixin2: var(--mixin1);\n // some other element:\n // --mixin1: 10px solid red;\n // --foo: var(--mixin1);\n // In this case, we leave the original variable definition in place.\n if (valueProperty) {\n prefix = `${matchText};${prefix}`;\n }\n return `${prefix}${out.join('; ')};`;\n }\n}\n\n/* exports */\n/* eslint-disable no-self-assign */\nApplyShim.prototype['detectMixin'] = ApplyShim.prototype.detectMixin;\nApplyShim.prototype['transformStyle'] = ApplyShim.prototype.transformStyle;\nApplyShim.prototype['transformCustomStyle'] = ApplyShim.prototype.transformCustomStyle;\nApplyShim.prototype['transformRules'] = ApplyShim.prototype.transformRules;\nApplyShim.prototype['transformRule'] = ApplyShim.prototype.transformRule;\nApplyShim.prototype['transformTemplate'] = ApplyShim.prototype.transformTemplate;\nApplyShim.prototype['_separator'] = MIXIN_VAR_SEP;\n/* eslint-enable no-self-assign */\nObject.defineProperty(ApplyShim.prototype, 'invalidCallback', {\n /** @return {?function(string)} */\n get() {\n return invalidCallback;\n },\n /** @param {?function(string)} cb */\n set(cb) {\n invalidCallback = cb;\n }\n});\n\nexport default ApplyShim;\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/**\n * @const {!Object<string, !HTMLTemplateElement>}\n */\nconst templateMap = {};\nexport default templateMap;\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\nimport templateMap from './template-map.js';\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\n\n/*\n * Utilities for handling invalidating apply-shim mixins for a given template.\n *\n * The invalidation strategy involves keeping track of the \"current\" version of a template's mixins, and updating that count when a mixin is invalidated.\n * The template\n */\n\n/** @const {string} */\nconst CURRENT_VERSION = '_applyShimCurrentVersion';\n\n/** @const {string} */\nconst NEXT_VERSION = '_applyShimNextVersion';\n\n/** @const {string} */\nconst VALIDATING_VERSION = '_applyShimValidatingVersion';\n\n/**\n * @const {Promise<void>}\n */\nconst promise = Promise.resolve();\n\n/**\n * @param {string} elementName\n */\nexport function invalidate(elementName){\n let template = templateMap[elementName];\n if (template) {\n invalidateTemplate(template);\n }\n}\n\n/**\n * This function can be called multiple times to mark a template invalid\n * and signal that the style inside must be regenerated.\n *\n * Use `startValidatingTemplate` to begin an asynchronous validation cycle.\n * During that cycle, call `templateIsValidating` to see if the template must\n * be revalidated\n * @param {HTMLTemplateElement} template\n */\nexport function invalidateTemplate(template) {\n // default the current version to 0\n template[CURRENT_VERSION] = template[CURRENT_VERSION] || 0;\n // ensure the \"validating for\" flag exists\n template[VALIDATING_VERSION] = template[VALIDATING_VERSION] || 0;\n // increment the next version\n template[NEXT_VERSION] = (template[NEXT_VERSION] || 0) + 1;\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValid(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValid(template);\n }\n return true;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValid(template) {\n return template[CURRENT_VERSION] === template[NEXT_VERSION];\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValidating(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValidating(template);\n }\n return false;\n}\n\n/**\n * Returns true if the template is currently invalid and `startValidating` has been called since the last invalidation.\n * If false, the template must be validated.\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValidating(template) {\n return !templateIsValid(template) && template[VALIDATING_VERSION] === template[NEXT_VERSION];\n}\n\n/**\n * the template is marked as `validating` for one microtask so that all instances\n * found in the tree crawl of `applyStyle` will update themselves,\n * but the template will only be updated once.\n * @param {string} elementName\n*/\nexport function startValidating(elementName) {\n let template = templateMap[elementName];\n startValidatingTemplate(template);\n}\n\n/**\n * Begin an asynchronous invalidation cycle.\n * This should be called after every validation of a template\n *\n * After one microtask, the template will be marked as valid until the next call to `invalidateTemplate`\n * @param {HTMLTemplateElement} template\n */\nexport function startValidatingTemplate(template) {\n // remember that the current \"next version\" is the reason for this validation cycle\n template[VALIDATING_VERSION] = template[NEXT_VERSION];\n // however, there only needs to be one async task to clear the counters\n if (!template._validating) {\n template._validating = true;\n promise.then(function() {\n // sync the current version to let future invalidations cause a refresh cycle\n template[CURRENT_VERSION] = template[NEXT_VERSION];\n template._validating = false;\n });\n }\n}\n\n/**\n * @return {boolean}\n */\nexport function elementsAreInvalid() {\n for (let elementName in templateMap) {\n let template = templateMap[elementName];\n if (!templateIsValid(template)) {\n return true;\n }\n }\n return false;\n}\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/** @type {Promise<void>} */\nlet readyPromise = null;\n\n/** @type {?function(?function())} */\nlet whenReady = window['HTMLImports'] && window['HTMLImports']['whenReady'] || null;\n\n/** @type {function()} */\nlet resolveFn;\n\n/**\n * @param {?function()} callback\n */\nexport default function documentWait(callback) {\n requestAnimationFrame(function() {\n if (whenReady) {\n whenReady(callback)\n } else {\n if (!readyPromise) {\n readyPromise = new Promise((resolve) => {resolveFn = resolve});\n if (document.readyState === 'complete') {\n resolveFn();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n resolveFn();\n }\n });\n }\n }\n readyPromise.then(function(){ callback && callback(); });\n }\n });\n}\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport documentWait from './document-wait.js';\n\n/**\n * @typedef {HTMLStyleElement | {getStyle: function():HTMLStyleElement}}\n */\nexport let CustomStyleProvider;\n\nconst SEEN_MARKER = '__seenByShadyCSS';\nconst CACHED_STYLE = '__shadyCSSCachedStyle';\n\n/** @type {?function(!HTMLStyleElement)} */\nlet transformFn = null;\n\n/** @type {?function()} */\nlet validateFn = null;\n\n/**\nThis interface is provided to add document-level <style> elements to ShadyCSS for processing.\nThese styles must be processed by ShadyCSS to simulate ShadowRoot upper-bound encapsulation from outside styles\nIn addition, these styles may also need to be processed for @apply rules and CSS Custom Properties\n\nTo add document-level styles to ShadyCSS, one can call `ShadyCSS.addDocumentStyle(styleElement)` or `ShadyCSS.addDocumentStyle({getStyle: () => styleElement})`\n\nIn addition, if the process used to discover document-level styles can be synchronously flushed, one should set `ShadyCSS.documentStyleFlush`.\nThis function will be called when calculating styles.\n\nAn example usage of the document-level styling api can be found in `examples/document-style-lib.js`\n\n@unrestricted\n*/\nexport default class CustomStyleInterface {\n constructor() {\n /** @type {!Array<!CustomStyleProvider>} */\n this['customStyles'] = [];\n this['enqueued'] = false;\n // NOTE(dfreedm): use quotes here to prevent closure inlining to `function(){}`;\n documentWait(() => {\n if (window['ShadyCSS']['flushCustomStyles']) {\n window['ShadyCSS']['flushCustomStyles']();\n }\n })\n }\n /**\n * Queue a validation for new custom styles to batch style recalculations\n */\n enqueueDocumentValidation() {\n if (this['enqueued'] || !validateFn) {\n return;\n }\n this['enqueued'] = true;\n documentWait(validateFn);\n }\n /**\n * @param {!HTMLStyleElement} style\n */\n addCustomStyle(style) {\n if (!style[SEEN_MARKER]) {\n style[SEEN_MARKER] = true;\n this['customStyles'].push(style);\n this.enqueueDocumentValidation();\n }\n }\n /**\n * @param {!CustomStyleProvider} customStyle\n * @return {HTMLStyleElement}\n */\n getStyleForCustomStyle(customStyle) {\n if (customStyle[CACHED_STYLE]) {\n return customStyle[CACHED_STYLE];\n }\n let style;\n if (customStyle['getStyle']) {\n style = customStyle['getStyle']();\n } else {\n style = customStyle;\n }\n return style;\n }\n /**\n * @return {!Array<!CustomStyleProvider>}\n */\n processStyles() {\n const cs = this['customStyles'];\n for (let i = 0; i < cs.length; i++) {\n const customStyle = cs[i];\n if (customStyle[CACHED_STYLE]) {\n continue;\n }\n const style = this.getStyleForCustomStyle(customStyle);\n if (style) {\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n const styleToTransform = /** @type {!HTMLStyleElement} */(style['__appliedElement'] || style);\n if (transformFn) {\n transformFn(styleToTransform);\n }\n customStyle[CACHED_STYLE] = styleToTransform;\n }\n }\n return cs;\n }\n}\n\n/* eslint-disable no-self-assign */\nCustomStyleInterface.prototype['addCustomStyle'] = CustomStyleInterface.prototype.addCustomStyle;\nCustomStyleInterface.prototype['getStyleForCustomStyle'] = CustomStyleInterface.prototype.getStyleForCustomStyle;\nCustomStyleInterface.prototype['processStyles'] = CustomStyleInterface.prototype.processStyles;\n/* eslint-enable no-self-assign */\n\nObject.defineProperties(CustomStyleInterface.prototype, {\n 'transformCallback': {\n /** @return {?function(!HTMLStyleElement)} */\n get() {\n return transformFn;\n },\n /** @param {?function(!HTMLStyleElement)} fn */\n set(fn) {\n transformFn = fn;\n }\n },\n 'validateCallback': {\n /** @return {?function()} */\n get() {\n return validateFn;\n },\n /**\n * @param {?function()} fn\n * @this {CustomStyleInterface}\n */\n set(fn) {\n let needsEnqueue = false;\n if (!validateFn) {\n needsEnqueue = true;\n }\n validateFn = fn;\n if (needsEnqueue) {\n this.enqueueDocumentValidation();\n }\n },\n }\n})\n\n/** @typedef {{\n * customStyles: !Array<!CustomStyleProvider>,\n * addCustomStyle: function(!CustomStyleProvider),\n * getStyleForCustomStyle: function(!CustomStyleProvider): HTMLStyleElement,\n * findStyles: function(),\n * transformCallback: ?function(!HTMLStyleElement),\n * validateCallback: ?function()\n * }}\n */\nexport const CustomStyleInterfaceInterface = {};\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport ApplyShim from '../src/apply-shim.js';\nimport templateMap from '../src/template-map.js';\nimport {getIsExtends, toCssText, elementHasBuiltCss} from '../src/style-util.js';\nimport * as ApplyShimUtils from '../src/apply-shim-utils.js';\nimport {getComputedStyleValue, updateNativeProperties} from '../src/common-utils.js';\nimport {CustomStyleInterfaceInterface} from '../src/custom-style-interface.js'; // eslint-disable-line no-unused-vars\nimport {nativeCssVariables, nativeShadow, cssBuild, disableRuntime} from '../src/style-settings.js';\n\n/** @const {ApplyShim} */\nconst applyShim = new ApplyShim();\n\nclass ApplyShimInterface {\n constructor() {\n /** @type {?CustomStyleInterfaceInterface} */\n this.customStyleInterface = null;\n applyShim['invalidCallback'] = ApplyShimUtils.invalidate;\n }\n ensure() {\n if (this.customStyleInterface) {\n return;\n }\n if (window.ShadyCSS.CustomStyleInterface) {\n this.customStyleInterface =\n /** @type {!CustomStyleInterfaceInterface} */ (\n window.ShadyCSS.CustomStyleInterface);\n this.customStyleInterface['transformCallback'] = (style) => {\n applyShim.transformCustomStyle(style);\n };\n this.customStyleInterface['validateCallback'] = () => {\n requestAnimationFrame(() => {\n if (this.customStyleInterface['enqueued']) {\n this.flushCustomStyles();\n }\n });\n }\n }\n }\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n */\n prepareTemplate(template, elementName) {\n this.ensure();\n if (elementHasBuiltCss(template)) {\n return;\n }\n templateMap[elementName] = template;\n let ast = applyShim.transformTemplate(template, elementName);\n // save original style ast to use for revalidating instances\n template['_styleAst'] = ast;\n }\n flushCustomStyles() {\n this.ensure();\n if (!this.customStyleInterface) {\n return;\n }\n let styles = this.customStyleInterface['processStyles']();\n if (!this.customStyleInterface['enqueued']) {\n return;\n }\n for (let i = 0; i < styles.length; i++ ) {\n let cs = styles[i];\n let style = this.customStyleInterface['getStyleForCustomStyle'](cs);\n if (style) {\n applyShim.transformCustomStyle(style);\n }\n }\n this.customStyleInterface['enqueued'] = false;\n }\n /**\n * @param {HTMLElement} element\n * @param {Object=} properties\n */\n styleSubtree(element, properties) {\n this.ensure();\n if (properties) {\n updateNativeProperties(element, properties);\n }\n if (element.shadowRoot) {\n this.styleElement(element);\n let shadowChildren =\n /** @type {!ParentNode} */ (element.shadowRoot).children ||\n element.shadowRoot.childNodes;\n for (let i = 0; i < shadowChildren.length; i++) {\n this.styleSubtree(/** @type {HTMLElement} */(shadowChildren[i]));\n }\n } else {\n let children = element.children || element.childNodes;\n for (let i = 0; i < children.length; i++) {\n this.styleSubtree(/** @type {HTMLElement} */(children[i]));\n }\n }\n }\n /**\n * @param {HTMLElement} element\n */\n styleElement(element) {\n this.ensure();\n let {is} = getIsExtends(element);\n let template = templateMap[is];\n if (template && elementHasBuiltCss(template)) {\n return;\n }\n if (template && !ApplyShimUtils.templateIsValid(template)) {\n // only revalidate template once\n if (!ApplyShimUtils.templateIsValidating(template)) {\n this.prepareTemplate(template, is);\n ApplyShimUtils.startValidatingTemplate(template);\n }\n // update this element instance\n let root = element.shadowRoot;\n if (root) {\n let style = /** @type {HTMLStyleElement} */(root.querySelector('style'));\n if (style) {\n // reuse the template's style ast, it has all the original css text\n style['__cssRules'] = template['_styleAst'];\n style.textContent = toCssText(template['_styleAst'])\n }\n }\n }\n }\n /**\n * @param {Object=} properties\n */\n styleDocument(properties) {\n this.ensure();\n this.styleSubtree(document.body, properties);\n }\n}\n\nif (!window.ShadyCSS || !window.ShadyCSS.ScopingShim) {\n const applyShimInterface = new ApplyShimInterface();\n let CustomStyleInterface = window.ShadyCSS && window.ShadyCSS.CustomStyleInterface;\n\n /** @suppress {duplicate} */\n window.ShadyCSS = {\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n prepareTemplate(template, elementName, elementExtends) { // eslint-disable-line no-unused-vars\n applyShimInterface.flushCustomStyles();\n applyShimInterface.prepareTemplate(template, elementName);\n },\n\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n prepareTemplateStyles(template, elementName, elementExtends) {\n window.ShadyCSS.prepareTemplate(template, elementName, elementExtends);\n },\n\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n */\n prepareTemplateDom(template, elementName) {}, // eslint-disable-line no-unused-vars\n\n /**\n * @param {!HTMLElement} element\n * @param {Object=} properties\n */\n styleSubtree(element, properties) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.styleSubtree(element, properties);\n },\n\n /**\n * @param {!HTMLElement} element\n */\n styleElement(element) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.styleElement(element);\n },\n\n /**\n * @param {Object=} properties\n */\n styleDocument(properties) {\n applyShimInterface.flushCustomStyles();\n applyShimInterface.styleDocument(properties);\n },\n\n /**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\n getComputedStyleValue(element, property) {\n return getComputedStyleValue(element, property);\n },\n\n flushCustomStyles() {\n applyShimInterface.flushCustomStyles();\n },\n\n nativeCss: nativeCssVariables,\n nativeShadow: nativeShadow,\n cssBuild: cssBuild,\n disableRuntime: disableRuntime,\n };\n\n if (CustomStyleInterface) {\n window.ShadyCSS.CustomStyleInterface = CustomStyleInterface;\n }\n}\n\nwindow.ShadyCSS.ApplyShim = applyShim;\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nimport './mixin.js';\nimport './async.js';\n\n/**\n * @summary Collapse multiple callbacks into one invocation after a timer.\n */\nexport class Debouncer {\n constructor() {\n this._asyncModule = null;\n this._callback = null;\n this._timer = null;\n }\n /**\n * Sets the scheduler; that is, a module with the Async interface,\n * a callback and optional arguments to be passed to the run function\n * from the async module.\n *\n * @param {!AsyncInterface} asyncModule Object with Async interface.\n * @param {function()} callback Callback to run.\n * @return {void}\n */\n setConfig(asyncModule, callback) {\n this._asyncModule = asyncModule;\n this._callback = callback;\n this._timer = this._asyncModule.run(() => {\n this._timer = null;\n debouncerQueue.delete(this);\n this._callback();\n });\n }\n /**\n * Cancels an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n cancel() {\n if (this.isActive()) {\n this._cancelAsync();\n // Canceling a debouncer removes its spot from the flush queue,\n // so if a debouncer is manually canceled and re-debounced, it\n // will reset its flush order (this is a very minor difference from 1.x)\n // Re-debouncing via the `debounce` API retains the 1.x FIFO flush order\n debouncerQueue.delete(this);\n }\n }\n /**\n * Cancels a debouncer's async callback.\n *\n * @return {void}\n */\n _cancelAsync() {\n if (this.isActive()) {\n this._asyncModule.cancel(/** @type {number} */(this._timer));\n this._timer = null;\n }\n }\n /**\n * Flushes an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n flush() {\n if (this.isActive()) {\n this.cancel();\n this._callback();\n }\n }\n /**\n * Returns true if the debouncer is active.\n *\n * @return {boolean} True if active.\n */\n isActive() {\n return this._timer != null;\n }\n /**\n * Creates a debouncer if no debouncer is passed as a parameter\n * or it cancels an active debouncer otherwise. The following\n * example shows how a debouncer can be called multiple times within a\n * microtask and \"debounced\" such that the provided callback function is\n * called once. Add this method to a custom element:\n *\n * ```js\n * import {microTask} from '@polymer/polymer/lib/utils/async.js';\n * import {Debouncer} from '@polymer/polymer/lib/utils/debounce.js';\n * // ...\n *\n * _debounceWork() {\n * this._debounceJob = Debouncer.debounce(this._debounceJob,\n * microTask, () => this._doWork());\n * }\n * ```\n *\n * If the `_debounceWork` method is called multiple times within the same\n * microtask, the `_doWork` function will be called only once at the next\n * microtask checkpoint.\n *\n * Note: In testing it is often convenient to avoid asynchrony. To accomplish\n * this with a debouncer, you can use `enqueueDebouncer` and\n * `flush`. For example, extend the above example by adding\n * `enqueueDebouncer(this._debounceJob)` at the end of the\n * `_debounceWork` method. Then in a test, call `flush` to ensure\n * the debouncer has completed.\n *\n * @param {Debouncer?} debouncer Debouncer object.\n * @param {!AsyncInterface} asyncModule Object with Async interface\n * @param {function()} callback Callback to run.\n * @return {!Debouncer} Returns a debouncer object.\n */\n static debounce(debouncer, asyncModule, callback) {\n if (debouncer instanceof Debouncer) {\n // Cancel the async callback, but leave in debouncerQueue if it was\n // enqueued, to maintain 1.x flush order\n debouncer._cancelAsync();\n } else {\n debouncer = new Debouncer();\n }\n debouncer.setConfig(asyncModule, callback);\n return debouncer;\n }\n}\n\nlet debouncerQueue = new Set();\n\n/**\n * Adds a `Debouncer` to a list of globally flushable tasks.\n *\n * @param {!Debouncer} debouncer Debouncer to enqueue\n * @return {void}\n */\nexport const enqueueDebouncer = function(debouncer) {\n debouncerQueue.add(debouncer);\n};\n\n/**\n * Flushes any enqueued debouncers\n *\n * @return {boolean} Returns whether any debouncers were flushed\n */\nexport const flushDebouncers = function() {\n const didFlush = Boolean(debouncerQueue.size);\n // If new debouncers are added while flushing, Set.forEach will ensure\n // newly added ones are also flushed\n debouncerQueue.forEach(debouncer => {\n try {\n debouncer.flush();\n } catch(e) {\n setTimeout(() => {\n throw e;\n });\n }\n });\n return didFlush;\n};", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * @fileoverview\n *\n * Module for adding listeners to a node for the following normalized\n * cross-platform \"gesture\" events:\n * - `down` - mouse or touch went down\n * - `up` - mouse or touch went up\n * - `tap` - mouse click or finger tap\n * - `track` - mouse drag or touch move\n *\n * @summary Module for adding cross-platform gesture event listeners.\n */\n\nimport './boot.js';\n\nimport { timeOut, microTask } from './async.js';\nimport { Debouncer } from './debounce.js';\nimport { passiveTouchGestures, cancelSyntheticClickEvents } from './settings.js';\nimport { wrap } from './wrap.js';\n\n// detect native touch action support\nlet HAS_NATIVE_TA = typeof document.head.style.touchAction === 'string';\nlet GESTURE_KEY = '__polymerGestures';\nlet HANDLED_OBJ = '__polymerGesturesHandled';\nlet TOUCH_ACTION = '__polymerGesturesTouchAction';\n// radius for tap and track\nlet TAP_DISTANCE = 25;\nlet TRACK_DISTANCE = 5;\n// number of last N track positions to keep\nlet TRACK_LENGTH = 2;\n\n// Disabling \"mouse\" handlers for 2500ms is enough\nlet MOUSE_TIMEOUT = 2500;\nlet MOUSE_EVENTS = ['mousedown', 'mousemove', 'mouseup', 'click'];\n// an array of bitmask values for mapping MouseEvent.which to MouseEvent.buttons\nlet MOUSE_WHICH_TO_BUTTONS = [0, 1, 4, 2];\nlet MOUSE_HAS_BUTTONS = (function() {\n try {\n return new MouseEvent('test', {buttons: 1}).buttons === 1;\n } catch (e) {\n return false;\n }\n})();\n\n/**\n * @param {string} name Possible mouse event name\n * @return {boolean} true if mouse event, false if not\n */\nfunction isMouseEvent(name) {\n return MOUSE_EVENTS.indexOf(name) > -1;\n}\n\n/* eslint no-empty: [\"error\", { \"allowEmptyCatch\": true }] */\n// check for passive event listeners\nlet supportsPassive = false;\n(function() {\n try {\n let opts = Object.defineProperty({}, 'passive', {get() {supportsPassive = true;}});\n window.addEventListener('test', null, opts);\n window.removeEventListener('test', null, opts);\n } catch(e) {}\n})();\n\n/**\n * Generate settings for event listeners, dependant on `passiveTouchGestures`\n *\n * @param {string} eventName Event name to determine if `{passive}` option is\n * needed\n * @return {{passive: boolean} | undefined} Options to use for addEventListener\n * and removeEventListener\n */\nfunction PASSIVE_TOUCH(eventName) {\n if (isMouseEvent(eventName) || eventName === 'touchend') {\n return;\n }\n if (HAS_NATIVE_TA && supportsPassive && passiveTouchGestures) {\n return {passive: true};\n } else {\n return;\n }\n}\n\n// Check for touch-only devices\nlet IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);\n\n// keep track of any labels hit by the mouseCanceller\n/** @type {!Array<!HTMLLabelElement>} */\nconst clickedLabels = [];\n\n/** @type {!Object<boolean>} */\nconst labellable = {\n 'button': true,\n 'input': true,\n 'keygen': true,\n 'meter': true,\n 'output': true,\n 'textarea': true,\n 'progress': true,\n 'select': true\n};\n\n// Defined at https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute\n/** @type {!Object<boolean>} */\nconst canBeDisabled = {\n 'button': true,\n 'command': true,\n 'fieldset': true,\n 'input': true,\n 'keygen': true,\n 'optgroup': true,\n 'option': true,\n 'select': true,\n 'textarea': true\n};\n\n/**\n * @param {HTMLElement} el Element to check labelling status\n * @return {boolean} element can have labels\n */\nfunction canBeLabelled(el) {\n return labellable[el.localName] || false;\n}\n\n/**\n * @param {HTMLElement} el Element that may be labelled.\n * @return {!Array<!HTMLLabelElement>} Relevant label for `el`\n */\nfunction matchingLabels(el) {\n let labels = Array.prototype.slice.call(/** @type {HTMLInputElement} */(el).labels || []);\n // IE doesn't have `labels` and Safari doesn't populate `labels`\n // if element is in a shadowroot.\n // In this instance, finding the non-ancestor labels is enough,\n // as the mouseCancellor code will handle ancstor labels\n if (!labels.length) {\n labels = [];\n try {\n let root = el.getRootNode();\n // if there is an id on `el`, check for all labels with a matching `for` attribute\n if (el.id) {\n let matching = root.querySelectorAll(`label[for = '${el.id}']`);\n for (let i = 0; i < matching.length; i++) {\n labels.push(/** @type {!HTMLLabelElement} */(matching[i]));\n }\n }\n } catch (e) {\n // Either:\n // 1. el.getRootNode() failed.\n // 2. el.id cannot be used in `querySelectorAll`\n // In both cases, do nothing.\n }\n }\n return labels;\n}\n\n// touch will make synthetic mouse events\n// `preventDefault` on touchend will cancel them,\n// but this breaks `<input>` focus and link clicks\n// disable mouse handlers for MOUSE_TIMEOUT ms after\n// a touchend to ignore synthetic mouse events\nlet mouseCanceller = function(mouseEvent) {\n // Check for sourceCapabilities, used to distinguish synthetic events\n // if mouseEvent did not come from a device that fires touch events,\n // it was made by a real mouse and should be counted\n // http://wicg.github.io/InputDeviceCapabilities/#dom-inputdevicecapabilities-firestouchevents\n let sc = mouseEvent.sourceCapabilities;\n if (sc && !sc.firesTouchEvents) {\n return;\n }\n // skip synthetic mouse events\n mouseEvent[HANDLED_OBJ] = {skip: true};\n // disable \"ghost clicks\"\n if (mouseEvent.type === 'click') {\n let clickFromLabel = false;\n let path = getComposedPath(mouseEvent);\n for (let i = 0; i < path.length; i++) {\n if (path[i].nodeType === Node.ELEMENT_NODE) {\n if (path[i].localName === 'label') {\n clickedLabels.push(/** @type {!HTMLLabelElement} */ (path[i]));\n } else if (canBeLabelled(/** @type {!HTMLElement} */ (path[i]))) {\n let ownerLabels =\n matchingLabels(/** @type {!HTMLElement} */ (path[i]));\n // check if one of the clicked labels is labelling this element\n for (let j = 0; j < ownerLabels.length; j++) {\n clickFromLabel = clickFromLabel || clickedLabels.indexOf(ownerLabels[j]) > -1;\n }\n }\n }\n if (path[i] === POINTERSTATE.mouse.target) {\n return;\n }\n }\n // if one of the clicked labels was labelling the target element,\n // this is not a ghost click\n if (clickFromLabel) {\n return;\n }\n mouseEvent.preventDefault();\n mouseEvent.stopPropagation();\n }\n};\n\n/**\n * @param {boolean=} setup True to add, false to remove.\n * @return {void}\n */\nfunction setupTeardownMouseCanceller(setup) {\n let events = IS_TOUCH_ONLY ? ['click'] : MOUSE_EVENTS;\n for (let i = 0, en; i < events.length; i++) {\n en = events[i];\n if (setup) {\n // reset clickLabels array\n clickedLabels.length = 0;\n document.addEventListener(en, mouseCanceller, true);\n } else {\n document.removeEventListener(en, mouseCanceller, true);\n }\n }\n}\n\nfunction ignoreMouse(e) {\n if (!cancelSyntheticClickEvents) {\n return;\n }\n if (!POINTERSTATE.mouse.mouseIgnoreJob) {\n setupTeardownMouseCanceller(true);\n }\n let unset = function() {\n setupTeardownMouseCanceller();\n POINTERSTATE.mouse.target = null;\n POINTERSTATE.mouse.mouseIgnoreJob = null;\n };\n POINTERSTATE.mouse.target = getComposedPath(e)[0];\n POINTERSTATE.mouse.mouseIgnoreJob = Debouncer.debounce(\n POINTERSTATE.mouse.mouseIgnoreJob\n , timeOut.after(MOUSE_TIMEOUT)\n , unset);\n}\n\n/**\n * @param {MouseEvent} ev event to test for left mouse button down\n * @return {boolean} has left mouse button down\n */\nfunction hasLeftMouseButton(ev) {\n let type = ev.type;\n // exit early if the event is not a mouse event\n if (!isMouseEvent(type)) {\n return false;\n }\n // ev.button is not reliable for mousemove (0 is overloaded as both left button and no buttons)\n // instead we use ev.buttons (bitmask of buttons) or fall back to ev.which (deprecated, 0 for no buttons, 1 for left button)\n if (type === 'mousemove') {\n // allow undefined for testing events\n let buttons = ev.buttons === undefined ? 1 : ev.buttons;\n if ((ev instanceof window.MouseEvent) && !MOUSE_HAS_BUTTONS) {\n buttons = MOUSE_WHICH_TO_BUTTONS[ev.which] || 0;\n }\n // buttons is a bitmask, check that the left button bit is set (1)\n return Boolean(buttons & 1);\n } else {\n // allow undefined for testing events\n let button = ev.button === undefined ? 0 : ev.button;\n // ev.button is 0 in mousedown/mouseup/click for left button activation\n return button === 0;\n }\n}\n\nfunction isSyntheticClick(ev) {\n if (ev.type === 'click') {\n // ev.detail is 0 for HTMLElement.click in most browsers\n if (ev.detail === 0) {\n return true;\n }\n // in the worst case, check that the x/y position of the click is within\n // the bounding box of the target of the event\n // Thanks IE 10 >:(\n let t = _findOriginalTarget(ev);\n // make sure the target of the event is an element so we can use getBoundingClientRect,\n // if not, just assume it is a synthetic click\n if (!t.nodeType || /** @type {Element} */(t).nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n let bcr = /** @type {Element} */(t).getBoundingClientRect();\n // use page x/y to account for scrolling\n let x = ev.pageX, y = ev.pageY;\n // ev is a synthetic click if the position is outside the bounding box of the target\n return !((x >= bcr.left && x <= bcr.right) && (y >= bcr.top && y <= bcr.bottom));\n }\n return false;\n}\n\nlet POINTERSTATE = {\n mouse: {\n target: null,\n mouseIgnoreJob: null\n },\n touch: {\n x: 0,\n y: 0,\n id: -1,\n scrollDecided: false\n }\n};\n\nfunction firstTouchAction(ev) {\n let ta = 'auto';\n let path = getComposedPath(ev);\n for (let i = 0, n; i < path.length; i++) {\n n = path[i];\n if (n[TOUCH_ACTION]) {\n ta = n[TOUCH_ACTION];\n break;\n }\n }\n return ta;\n}\n\nfunction trackDocument(stateObj, movefn, upfn) {\n stateObj.movefn = movefn;\n stateObj.upfn = upfn;\n document.addEventListener('mousemove', movefn);\n document.addEventListener('mouseup', upfn);\n}\n\nfunction untrackDocument(stateObj) {\n document.removeEventListener('mousemove', stateObj.movefn);\n document.removeEventListener('mouseup', stateObj.upfn);\n stateObj.movefn = null;\n stateObj.upfn = null;\n}\n\nif (cancelSyntheticClickEvents) {\n // use a document-wide touchend listener to start the ghost-click prevention mechanism\n // Use passive event listeners, if supported, to not affect scrolling performance\n document.addEventListener('touchend', ignoreMouse, supportsPassive ? {passive: true} : false);\n}\n\n/**\n * Returns the composedPath for the given event.\n * @param {Event} event to process\n * @return {!Array<!EventTarget>} Path of the event\n */\nconst getComposedPath = window.ShadyDOM && window.ShadyDOM.noPatch ?\n window.ShadyDOM.composedPath :\n (event) => event.composedPath && event.composedPath() || [];\n\n/** @type {!Object<string, !GestureRecognizer>} */\nexport const gestures = {};\n\n/** @type {!Array<!GestureRecognizer>} */\nexport const recognizers = [];\n\n/**\n * Finds the element rendered on the screen at the provided coordinates.\n *\n * Similar to `document.elementFromPoint`, but pierces through\n * shadow roots.\n *\n * @param {number} x Horizontal pixel coordinate\n * @param {number} y Vertical pixel coordinate\n * @return {Element} Returns the deepest shadowRoot inclusive element\n * found at the screen position given.\n */\nexport function deepTargetFind(x, y) {\n let node = document.elementFromPoint(x, y);\n let next = node;\n // this code path is only taken when native ShadowDOM is used\n // if there is a shadowroot, it may have a node at x/y\n // if there is not a shadowroot, exit the loop\n while (next && next.shadowRoot && !window.ShadyDOM) {\n // if there is a node at x/y in the shadowroot, look deeper\n let oldNext = next;\n next = next.shadowRoot.elementFromPoint(x, y);\n // on Safari, elementFromPoint may return the shadowRoot host\n if (oldNext === next) {\n break;\n }\n if (next) {\n node = next;\n }\n }\n return node;\n}\n\n/**\n * a cheaper check than ev.composedPath()[0];\n *\n * @private\n * @param {Event|Touch} ev Event.\n * @return {EventTarget} Returns the event target.\n */\nfunction _findOriginalTarget(ev) {\n const path = getComposedPath(/** @type {?Event} */ (ev));\n // It shouldn't be, but sometimes path is empty (window on Safari).\n return path.length > 0 ? path[0] : ev.target;\n}\n\n/**\n * @private\n * @param {Event} ev Event.\n * @return {void}\n */\nfunction _handleNative(ev) {\n let handled;\n let type = ev.type;\n let node = ev.currentTarget;\n let gobj = node[GESTURE_KEY];\n if (!gobj) {\n return;\n }\n let gs = gobj[type];\n if (!gs) {\n return;\n }\n if (!ev[HANDLED_OBJ]) {\n ev[HANDLED_OBJ] = {};\n if (type.slice(0, 5) === 'touch') {\n ev = /** @type {TouchEvent} */(ev); // eslint-disable-line no-self-assign\n let t = ev.changedTouches[0];\n if (type === 'touchstart') {\n // only handle the first finger\n if (ev.touches.length === 1) {\n POINTERSTATE.touch.id = t.identifier;\n }\n }\n if (POINTERSTATE.touch.id !== t.identifier) {\n return;\n }\n if (!HAS_NATIVE_TA) {\n if (type === 'touchstart' || type === 'touchmove') {\n _handleTouchAction(ev);\n }\n }\n }\n }\n handled = ev[HANDLED_OBJ];\n // used to ignore synthetic mouse events\n if (handled.skip) {\n return;\n }\n // reset recognizer state\n for (let i = 0, r; i < recognizers.length; i++) {\n r = recognizers[i];\n if (gs[r.name] && !handled[r.name]) {\n if (r.flow && r.flow.start.indexOf(ev.type) > -1 && r.reset) {\n r.reset();\n }\n }\n }\n // enforce gesture recognizer order\n for (let i = 0, r; i < recognizers.length; i++) {\n r = recognizers[i];\n if (gs[r.name] && !handled[r.name]) {\n handled[r.name] = true;\n r[type](ev);\n }\n }\n}\n\n/**\n * @private\n * @param {TouchEvent} ev Event.\n * @return {void}\n */\nfunction _handleTouchAction(ev) {\n let t = ev.changedTouches[0];\n let type = ev.type;\n if (type === 'touchstart') {\n POINTERSTATE.touch.x = t.clientX;\n POINTERSTATE.touch.y = t.clientY;\n POINTERSTATE.touch.scrollDecided = false;\n } else if (type === 'touchmove') {\n if (POINTERSTATE.touch.scrollDecided) {\n return;\n }\n POINTERSTATE.touch.scrollDecided = true;\n let ta = firstTouchAction(ev);\n let shouldPrevent = false;\n let dx = Math.abs(POINTERSTATE.touch.x - t.clientX);\n let dy = Math.abs(POINTERSTATE.touch.y - t.clientY);\n if (!ev.cancelable) {\n // scrolling is happening\n } else if (ta === 'none') {\n shouldPrevent = true;\n } else if (ta === 'pan-x') {\n shouldPrevent = dy > dx;\n } else if (ta === 'pan-y') {\n shouldPrevent = dx > dy;\n }\n if (shouldPrevent) {\n ev.preventDefault();\n } else {\n prevent('track');\n }\n }\n}\n\n/**\n * Adds an event listener to a node for the given gesture type.\n *\n * @param {!EventTarget} node Node to add listener on\n * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`\n * @param {!function(!Event):void} handler Event listener function to call\n * @return {boolean} Returns true if a gesture event listener was added.\n */\nexport function addListener(node, evType, handler) {\n if (gestures[evType]) {\n _add(node, evType, handler);\n return true;\n }\n return false;\n}\n\n/**\n * Removes an event listener from a node for the given gesture type.\n *\n * @param {!EventTarget} node Node to remove listener from\n * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`\n * @param {!function(!Event):void} handler Event listener function previously passed to\n * `addListener`.\n * @return {boolean} Returns true if a gesture event listener was removed.\n */\nexport function removeListener(node, evType, handler) {\n if (gestures[evType]) {\n _remove(node, evType, handler);\n return true;\n }\n return false;\n}\n\n/**\n * automate the event listeners for the native events\n *\n * @private\n * @param {!EventTarget} node Node on which to add the event.\n * @param {string} evType Event type to add.\n * @param {function(!Event)} handler Event handler function.\n * @return {void}\n */\nfunction _add(node, evType, handler) {\n let recognizer = gestures[evType];\n let deps = recognizer.deps;\n let name = recognizer.name;\n let gobj = node[GESTURE_KEY];\n if (!gobj) {\n node[GESTURE_KEY] = gobj = {};\n }\n for (let i = 0, dep, gd; i < deps.length; i++) {\n dep = deps[i];\n // don't add mouse handlers on iOS because they cause gray selection overlays\n if (IS_TOUCH_ONLY && isMouseEvent(dep) && dep !== 'click') {\n continue;\n }\n gd = gobj[dep];\n if (!gd) {\n gobj[dep] = gd = {_count: 0};\n }\n if (gd._count === 0) {\n node.addEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));\n }\n gd[name] = (gd[name] || 0) + 1;\n gd._count = (gd._count || 0) + 1;\n }\n node.addEventListener(evType, handler);\n if (recognizer.touchAction) {\n setTouchAction(node, recognizer.touchAction);\n }\n}\n\n/**\n * automate event listener removal for native events\n *\n * @private\n * @param {!EventTarget} node Node on which to remove the event.\n * @param {string} evType Event type to remove.\n * @param {function(!Event): void} handler Event handler function.\n * @return {void}\n */\nfunction _remove(node, evType, handler) {\n let recognizer = gestures[evType];\n let deps = recognizer.deps;\n let name = recognizer.name;\n let gobj = node[GESTURE_KEY];\n if (gobj) {\n for (let i = 0, dep, gd; i < deps.length; i++) {\n dep = deps[i];\n gd = gobj[dep];\n if (gd && gd[name]) {\n gd[name] = (gd[name] || 1) - 1;\n gd._count = (gd._count || 1) - 1;\n if (gd._count === 0) {\n node.removeEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));\n }\n }\n }\n }\n node.removeEventListener(evType, handler);\n}\n\n/**\n * Registers a new gesture event recognizer for adding new custom\n * gesture event types.\n *\n * @param {!GestureRecognizer} recog Gesture recognizer descriptor\n * @return {void}\n */\nexport function register(recog) {\n recognizers.push(recog);\n for (let i = 0; i < recog.emits.length; i++) {\n gestures[recog.emits[i]] = recog;\n }\n}\n\n/**\n * @private\n * @param {string} evName Event name.\n * @return {Object} Returns the gesture for the given event name.\n */\nfunction _findRecognizerByEvent(evName) {\n for (let i = 0, r; i < recognizers.length; i++) {\n r = recognizers[i];\n for (let j = 0, n; j < r.emits.length; j++) {\n n = r.emits[j];\n if (n === evName) {\n return r;\n }\n }\n }\n return null;\n}\n\n/**\n * Sets scrolling direction on node.\n *\n * This value is checked on first move, thus it should be called prior to\n * adding event listeners.\n *\n * @param {!EventTarget} node Node to set touch action setting on\n * @param {string} value Touch action value\n * @return {void}\n */\nexport function setTouchAction(node, value) {\n if (HAS_NATIVE_TA && node instanceof HTMLElement) {\n // NOTE: add touchAction async so that events can be added in\n // custom element constructors. Otherwise we run afoul of custom\n // elements restriction against settings attributes (style) in the\n // constructor.\n microTask.run(() => {\n node.style.touchAction = value;\n });\n }\n node[TOUCH_ACTION] = value;\n}\n\n/**\n * Dispatches an event on the `target` element of `type` with the given\n * `detail`.\n * @private\n * @param {!EventTarget} target The element on which to fire an event.\n * @param {string} type The type of event to fire.\n * @param {!Object=} detail The detail object to populate on the event.\n * @return {void}\n */\nfunction _fire(target, type, detail) {\n let ev = new Event(type, { bubbles: true, cancelable: true, composed: true });\n ev.detail = detail;\n wrap(/** @type {!Node} */(target)).dispatchEvent(ev);\n // forward `preventDefault` in a clean way\n if (ev.defaultPrevented) {\n let preventer = detail.preventer || detail.sourceEvent;\n if (preventer && preventer.preventDefault) {\n preventer.preventDefault();\n }\n }\n}\n\n/**\n * Prevents the dispatch and default action of the given event name.\n *\n * @param {string} evName Event name.\n * @return {void}\n */\nexport function prevent(evName) {\n let recognizer = _findRecognizerByEvent(evName);\n if (recognizer.info) {\n recognizer.info.prevent = true;\n }\n}\n\n/**\n * Reset the 2500ms timeout on processing mouse input after detecting touch input.\n *\n * Touch inputs create synthesized mouse inputs anywhere from 0 to 2000ms after the touch.\n * This method should only be called during testing with simulated touch inputs.\n * Calling this method in production may cause duplicate taps or other Gestures.\n *\n * @return {void}\n */\nexport function resetMouseCanceller() {\n if (POINTERSTATE.mouse.mouseIgnoreJob) {\n POINTERSTATE.mouse.mouseIgnoreJob.flush();\n }\n}\n\n/* eslint-disable valid-jsdoc */\n\nregister({\n name: 'downup',\n deps: ['mousedown', 'touchstart', 'touchend'],\n flow: {\n start: ['mousedown', 'touchstart'],\n end: ['mouseup', 'touchend']\n },\n emits: ['down', 'up'],\n\n info: {\n movefn: null,\n upfn: null\n },\n\n /**\n * @this {GestureRecognizer}\n * @return {void}\n */\n reset: function() {\n untrackDocument(this.info);\n },\n\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n mousedown: function(e) {\n if (!hasLeftMouseButton(e)) {\n return;\n }\n let t = _findOriginalTarget(e);\n let self = this;\n let movefn = function movefn(e) {\n if (!hasLeftMouseButton(e)) {\n downupFire('up', t, e);\n untrackDocument(self.info);\n }\n };\n let upfn = function upfn(e) {\n if (hasLeftMouseButton(e)) {\n downupFire('up', t, e);\n }\n untrackDocument(self.info);\n };\n trackDocument(this.info, movefn, upfn);\n downupFire('down', t, e);\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchstart: function(e) {\n downupFire('down', _findOriginalTarget(e), e.changedTouches[0], e);\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchend: function(e) {\n downupFire('up', _findOriginalTarget(e), e.changedTouches[0], e);\n }\n});\n\n/**\n * @param {string} type\n * @param {EventTarget} target\n * @param {Event|Touch} event\n * @param {Event=} preventer\n * @return {void}\n */\nfunction downupFire(type, target, event, preventer) {\n if (!target) {\n return;\n }\n _fire(target, type, {\n x: event.clientX,\n y: event.clientY,\n sourceEvent: event,\n preventer: preventer,\n prevent: function(e) {\n return prevent(e);\n }\n });\n}\n\nregister({\n name: 'track',\n touchAction: 'none',\n deps: ['mousedown', 'touchstart', 'touchmove', 'touchend'],\n flow: {\n start: ['mousedown', 'touchstart'],\n end: ['mouseup', 'touchend']\n },\n emits: ['track'],\n\n info: {\n x: 0,\n y: 0,\n state: 'start',\n started: false,\n moves: [],\n /** @this {GestureInfo} */\n addMove: function(move) {\n if (this.moves.length > TRACK_LENGTH) {\n this.moves.shift();\n }\n this.moves.push(move);\n },\n movefn: null,\n upfn: null,\n prevent: false\n },\n\n /**\n * @this {GestureRecognizer}\n * @return {void}\n */\n reset: function() {\n this.info.state = 'start';\n this.info.started = false;\n this.info.moves = [];\n this.info.x = 0;\n this.info.y = 0;\n this.info.prevent = false;\n untrackDocument(this.info);\n },\n\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n mousedown: function(e) {\n if (!hasLeftMouseButton(e)) {\n return;\n }\n let t = _findOriginalTarget(e);\n let self = this;\n let movefn = function movefn(e) {\n let x = e.clientX, y = e.clientY;\n if (trackHasMovedEnough(self.info, x, y)) {\n // first move is 'start', subsequent moves are 'move', mouseup is 'end'\n self.info.state = self.info.started ? (e.type === 'mouseup' ? 'end' : 'track') : 'start';\n if (self.info.state === 'start') {\n // if and only if tracking, always prevent tap\n prevent('tap');\n }\n self.info.addMove({x: x, y: y});\n if (!hasLeftMouseButton(e)) {\n // always fire \"end\"\n self.info.state = 'end';\n untrackDocument(self.info);\n }\n if (t) {\n trackFire(self.info, t, e);\n }\n self.info.started = true;\n }\n };\n let upfn = function upfn(e) {\n if (self.info.started) {\n movefn(e);\n }\n\n // remove the temporary listeners\n untrackDocument(self.info);\n };\n // add temporary document listeners as mouse retargets\n trackDocument(this.info, movefn, upfn);\n this.info.x = e.clientX;\n this.info.y = e.clientY;\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchstart: function(e) {\n let ct = e.changedTouches[0];\n this.info.x = ct.clientX;\n this.info.y = ct.clientY;\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchmove: function(e) {\n let t = _findOriginalTarget(e);\n let ct = e.changedTouches[0];\n let x = ct.clientX, y = ct.clientY;\n if (trackHasMovedEnough(this.info, x, y)) {\n if (this.info.state === 'start') {\n // if and only if tracking, always prevent tap\n prevent('tap');\n }\n this.info.addMove({x: x, y: y});\n trackFire(this.info, t, ct);\n this.info.state = 'track';\n this.info.started = true;\n }\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchend: function(e) {\n let t = _findOriginalTarget(e);\n let ct = e.changedTouches[0];\n // only trackend if track was started and not aborted\n if (this.info.started) {\n // reset started state on up\n this.info.state = 'end';\n this.info.addMove({x: ct.clientX, y: ct.clientY});\n trackFire(this.info, t, ct);\n }\n }\n});\n\n/**\n * @param {!GestureInfo} info\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction trackHasMovedEnough(info, x, y) {\n if (info.prevent) {\n return false;\n }\n if (info.started) {\n return true;\n }\n let dx = Math.abs(info.x - x);\n let dy = Math.abs(info.y - y);\n return (dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE);\n}\n\n/**\n * @param {!GestureInfo} info\n * @param {?EventTarget} target\n * @param {Touch} touch\n * @return {void}\n */\nfunction trackFire(info, target, touch) {\n if (!target) {\n return;\n }\n let secondlast = info.moves[info.moves.length - 2];\n let lastmove = info.moves[info.moves.length - 1];\n let dx = lastmove.x - info.x;\n let dy = lastmove.y - info.y;\n let ddx, ddy = 0;\n if (secondlast) {\n ddx = lastmove.x - secondlast.x;\n ddy = lastmove.y - secondlast.y;\n }\n _fire(target, 'track', {\n state: info.state,\n x: touch.clientX,\n y: touch.clientY,\n dx: dx,\n dy: dy,\n ddx: ddx,\n ddy: ddy,\n sourceEvent: touch,\n hover: function() {\n return deepTargetFind(touch.clientX, touch.clientY);\n }\n });\n}\n\nregister({\n name: 'tap',\n deps: ['mousedown', 'click', 'touchstart', 'touchend'],\n flow: {\n start: ['mousedown', 'touchstart'],\n end: ['click', 'touchend']\n },\n emits: ['tap'],\n info: {\n x: NaN,\n y: NaN,\n prevent: false\n },\n /**\n * @this {GestureRecognizer}\n * @return {void}\n */\n reset: function() {\n this.info.x = NaN;\n this.info.y = NaN;\n this.info.prevent = false;\n },\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n mousedown: function(e) {\n if (hasLeftMouseButton(e)) {\n this.info.x = e.clientX;\n this.info.y = e.clientY;\n }\n },\n /**\n * @this {GestureRecognizer}\n * @param {MouseEvent} e\n * @return {void}\n */\n click: function(e) {\n if (hasLeftMouseButton(e)) {\n trackForward(this.info, e);\n }\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchstart: function(e) {\n const touch = e.changedTouches[0];\n this.info.x = touch.clientX;\n this.info.y = touch.clientY;\n },\n /**\n * @this {GestureRecognizer}\n * @param {TouchEvent} e\n * @return {void}\n */\n touchend: function(e) {\n trackForward(this.info, e.changedTouches[0], e);\n }\n});\n\n/**\n * @param {!GestureInfo} info\n * @param {Event | Touch} e\n * @param {Event=} preventer\n * @return {void}\n */\nfunction trackForward(info, e, preventer) {\n let dx = Math.abs(e.clientX - info.x);\n let dy = Math.abs(e.clientY - info.y);\n // find original target from `preventer` for TouchEvents, or `e` for MouseEvents\n let t = _findOriginalTarget((preventer || e));\n if (!t || (canBeDisabled[/** @type {!HTMLElement} */(t).localName] && t.hasAttribute('disabled'))) {\n return;\n }\n // dx,dy can be NaN if `click` has been simulated and there was no `down` for `start`\n if (isNaN(dx) || isNaN(dy) || (dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) || isSyntheticClick(e)) {\n // prevent taps from being generated if an event has canceled them\n if (!info.prevent) {\n _fire(t, 'tap', {\n x: e.clientX,\n y: e.clientY,\n sourceEvent: e,\n preventer: preventer\n });\n }\n }\n}\n\n/* eslint-enable valid-jsdoc */\n\n/** @deprecated */\nexport const findOriginalTarget = _findOriginalTarget;\n\n/** @deprecated */\nexport const add = addListener;\n\n/** @deprecated */\nexport const remove = removeListener;\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { addListener, removeListener } from '../utils/gestures.js';\n\n/**\n * Element class mixin that provides API for adding Polymer's cross-platform\n * gesture events to nodes.\n *\n * The API is designed to be compatible with override points implemented\n * in `TemplateStamp` such that declarative event listeners in\n * templates will support gesture events when this mixin is applied along with\n * `TemplateStamp`.\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin that provides API for adding Polymer's\n * cross-platform gesture events to nodes\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const GestureEventListeners = dedupingMixin((superClass) => {\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_GestureEventListeners}\n */\n class GestureEventListeners extends superClass {\n /**\n * Add the event listener to the node if it is a gestures event.\n *\n * @param {!EventTarget} node Node to add event listener to\n * @param {string} eventName Name of event\n * @param {function(!Event):void} handler Listener function to add\n * @return {void}\n * @override\n */\n _addEventListenerToNode(node, eventName, handler) {\n if (!addListener(node, eventName, handler)) {\n super._addEventListenerToNode(node, eventName, handler);\n }\n }\n\n /**\n * Remove the event listener to the node if it is a gestures event.\n *\n * @param {!EventTarget} node Node to remove event listener from\n * @param {string} eventName Name of event\n * @param {function(!Event):void} handler Listener function to remove\n * @return {void}\n * @override\n */\n _removeEventListenerFromNode(node, eventName, handler) {\n if (!removeListener(node, eventName, handler)) {\n super._removeEventListenerFromNode(node, eventName, handler);\n }\n }\n }\n\n return GestureEventListeners;\n});\n", "/**\n * @fileoverview\n * @suppress {checkPrototypalTypes}\n * @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport { PropertyAccessors } from './property-accessors.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\n\nconst HOST_DIR = /:host\\(:dir\\((ltr|rtl)\\)\\)/g;\nconst HOST_DIR_REPLACMENT = ':host([dir=\"$1\"])';\n\nconst EL_DIR = /([\\s\\w-#\\.\\[\\]\\*]*):dir\\((ltr|rtl)\\)/g;\nconst EL_DIR_REPLACMENT = ':host([dir=\"$2\"]) $1';\n\nconst DIR_CHECK = /:dir\\((?:ltr|rtl)\\)/;\n\nconst SHIM_SHADOW = Boolean(window['ShadyDOM'] && window['ShadyDOM']['inUse']);\n\n/**\n * @type {!Array<!Polymer_DirMixin>}\n */\nconst DIR_INSTANCES = [];\n\n/** @type {?MutationObserver} */\nlet observer = null;\n\nlet documentDir = '';\n\nfunction getRTL() {\n documentDir = document.documentElement.getAttribute('dir');\n}\n\n/**\n * @param {!Polymer_DirMixin} instance Instance to set RTL status on\n */\nfunction setRTL(instance) {\n if (!instance.__autoDirOptOut) {\n const el = /** @type {!HTMLElement} */(instance);\n el.setAttribute('dir', documentDir);\n }\n}\n\nfunction updateDirection() {\n getRTL();\n documentDir = document.documentElement.getAttribute('dir');\n for (let i = 0; i < DIR_INSTANCES.length; i++) {\n setRTL(DIR_INSTANCES[i]);\n }\n}\n\nfunction takeRecords() {\n if (observer && observer.takeRecords().length) {\n updateDirection();\n }\n}\n\n/**\n * Element class mixin that allows elements to use the `:dir` CSS Selector to\n * have text direction specific styling.\n *\n * With this mixin, any stylesheet provided in the template will transform\n * `:dir` into `:host([dir])` and sync direction with the page via the\n * element's `dir` attribute.\n *\n * Elements can opt out of the global page text direction by setting the `dir`\n * attribute directly in `ready()` or in HTML.\n *\n * Caveats:\n * - Applications must set `<html dir=\"ltr\">` or `<html dir=\"rtl\">` to sync\n * direction\n * - Automatic left-to-right or right-to-left styling is sync'd with the\n * `<html>` element only.\n * - Changing `dir` at runtime is supported.\n * - Opting out of the global direction styling is permanent\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin PropertyAccessors\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const DirMixin = dedupingMixin((base) => {\n\n if (!SHIM_SHADOW) {\n if (!observer) {\n getRTL();\n observer = new MutationObserver(updateDirection);\n observer.observe(document.documentElement, {attributes: true, attributeFilter: ['dir']});\n }\n }\n\n /**\n * @constructor\n * @implements {Polymer_PropertyAccessors}\n * @private\n */\n const elementBase = PropertyAccessors(base);\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_DirMixin}\n */\n class Dir extends elementBase {\n\n /**\n * @param {string} cssText .\n * @param {string} baseURI .\n * @return {string} .\n * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n * @nocollapse\n */\n static _processStyleText(cssText, baseURI) {\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n cssText = elementBase._processStyleText.call(this, cssText, baseURI);\n if (!SHIM_SHADOW && DIR_CHECK.test(cssText)) {\n cssText = this._replaceDirInCssText(cssText);\n this.__activateDir = true;\n }\n return cssText;\n }\n\n /**\n * Replace `:dir` in the given CSS text\n *\n * @param {string} text CSS text to replace DIR\n * @return {string} Modified CSS\n * @nocollapse\n */\n static _replaceDirInCssText(text) {\n let replacedText = text;\n replacedText = replacedText.replace(HOST_DIR, HOST_DIR_REPLACMENT);\n replacedText = replacedText.replace(EL_DIR, EL_DIR_REPLACMENT);\n return replacedText;\n }\n\n constructor() {\n super();\n /** @type {boolean} */\n this.__autoDirOptOut = false;\n }\n\n /**\n * @override\n * @suppress {invalidCasts} Closure doesn't understand that `this` is an\n * HTMLElement\n * @return {void}\n */\n ready() {\n super.ready();\n this.__autoDirOptOut = /** @type {!HTMLElement} */(this).hasAttribute('dir');\n }\n\n /**\n * @override\n * @suppress {missingProperties} If it exists on elementBase, it can be\n * super'd\n * @return {void}\n */\n connectedCallback() {\n if (elementBase.prototype.connectedCallback) {\n super.connectedCallback();\n }\n if (this.constructor.__activateDir) {\n takeRecords();\n DIR_INSTANCES.push(this);\n setRTL(this);\n }\n }\n\n /**\n * @override\n * @suppress {missingProperties} If it exists on elementBase, it can be\n * super'd\n * @return {void}\n */\n disconnectedCallback() {\n if (elementBase.prototype.disconnectedCallback) {\n super.disconnectedCallback();\n }\n if (this.constructor.__activateDir) {\n const idx = DIR_INSTANCES.indexOf(this);\n if (idx > -1) {\n DIR_INSTANCES.splice(idx, 1);\n }\n }\n }\n }\n\n Dir.__activateDir = false;\n\n return Dir;\n});\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nfunction resolve() {\n document.body.removeAttribute('unresolved');\n}\n\nif (document.readyState === 'interactive' || document.readyState === 'complete') {\n resolve();\n} else {\n window.addEventListener('DOMContentLoaded', resolve);\n}\n\nexport {};\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nfunction newSplice(index, removed, addedCount) {\n return {\n index: index,\n removed: removed,\n addedCount: addedCount\n };\n}\n\nconst EDIT_LEAVE = 0;\nconst EDIT_UPDATE = 1;\nconst EDIT_ADD = 2;\nconst EDIT_DELETE = 3;\n\n// Note: This function is *based* on the computation of the Levenshtein\n// \"edit\" distance. The one change is that \"updates\" are treated as two\n// edits - not one. With Array splices, an update is really a delete\n// followed by an add. By retaining this, we optimize for \"keeping\" the\n// maximum array items in the original array. For example:\n//\n// 'xxxx123' -> '123yyyy'\n//\n// With 1-edit updates, the shortest path would be just to update all seven\n// characters. With 2-edit updates, we delete 4, leave 3, and add 4. This\n// leaves the substring '123' intact.\nfunction calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n // \"Deletion\" columns\n let rowCount = oldEnd - oldStart + 1;\n let columnCount = currentEnd - currentStart + 1;\n let distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (let j = 0; j < columnCount; j++)\n distances[0][j] = j;\n\n for (let i = 1; i < rowCount; i++) {\n for (let j = 1; j < columnCount; j++) {\n if (equals(current[currentStart + j - 1], old[oldStart + i - 1]))\n distances[i][j] = distances[i - 1][j - 1];\n else {\n let north = distances[i - 1][j] + 1;\n let west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n}\n\n// This starts at the final weight, and walks \"backward\" by finding\n// the minimum previous weight recursively until the origin of the weight\n// matrix.\nfunction spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n let edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n let northWest = distances[i - 1][j - 1];\n let west = distances[i - 1][j];\n let north = distances[i][j - 1];\n\n let min;\n if (west < north)\n min = west < northWest ? west : northWest;\n else\n min = north < northWest ? north : northWest;\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n}\n\n/**\n * Splice Projection functions:\n *\n * A splice map is a representation of how a previous array of items\n * was transformed into a new array of items. Conceptually it is a list of\n * tuples of\n *\n * <index, removed, addedCount>\n *\n * which are kept in ascending index order of. The tuple represents that at\n * the |index|, |removed| sequence of items were removed, and counting forward\n * from |index|, |addedCount| items were added.\n */\n\n/**\n * Lacking individual splice mutation information, the minimal set of\n * splices can be synthesized given the previous state and final state of an\n * array. The basic approach is to calculate the edit distance matrix and\n * choose the shortest path through it.\n *\n * Complexity: O(l * p)\n * l: The length of the current array\n * p: The length of the old array\n *\n * @param {!Array} current The current \"changed\" array for which to\n * calculate splices.\n * @param {number} currentStart Starting index in the `current` array for\n * which splices are calculated.\n * @param {number} currentEnd Ending index in the `current` array for\n * which splices are calculated.\n * @param {!Array} old The original \"unchanged\" array to compare `current`\n * against to determine splices.\n * @param {number} oldStart Starting index in the `old` array for\n * which splices are calculated.\n * @param {number} oldEnd Ending index in the `old` array for\n * which splices are calculated.\n * @return {!Array} Returns an array of splice record objects. Each of these\n * contains: `index` the location where the splice occurred; `removed`\n * the array of removed items from this location; `addedCount` the number\n * of items added at this location.\n */\nfunction calcSplices(current, currentStart, currentEnd,\n old, oldStart, oldEnd) {\n let prefixCount = 0;\n let suffixCount = 0;\n let splice;\n\n let minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);\n if (currentStart == 0 && oldStart == 0)\n prefixCount = sharedPrefix(current, old, minLength);\n\n if (currentEnd == current.length && oldEnd == old.length)\n suffixCount = sharedSuffix(current, old, minLength - prefixCount);\n\n currentStart += prefixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\n if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)\n return [];\n\n if (currentStart == currentEnd) {\n splice = newSplice(currentStart, [], 0);\n while (oldStart < oldEnd)\n splice.removed.push(old[oldStart++]);\n\n return [ splice ];\n } else if (oldStart == oldEnd)\n return [ newSplice(currentStart, [], currentEnd - currentStart) ];\n\n let ops = spliceOperationsFromEditDistances(\n calcEditDistances(current, currentStart, currentEnd,\n old, oldStart, oldEnd));\n\n splice = undefined;\n let splices = [];\n let index = currentStart;\n let oldIndex = oldStart;\n for (let i = 0; i < ops.length; i++) {\n switch(ops[i]) {\n case EDIT_LEAVE:\n if (splice) {\n splices.push(splice);\n splice = undefined;\n }\n\n index++;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n case EDIT_ADD:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.addedCount++;\n index++;\n break;\n case EDIT_DELETE:\n if (!splice)\n splice = newSplice(index, [], 0);\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n }\n }\n\n if (splice) {\n splices.push(splice);\n }\n return splices;\n}\n\nfunction sharedPrefix(current, old, searchLength) {\n for (let i = 0; i < searchLength; i++)\n if (!equals(current[i], old[i]))\n return i;\n return searchLength;\n}\n\nfunction sharedSuffix(current, old, searchLength) {\n let index1 = current.length;\n let index2 = old.length;\n let count = 0;\n while (count < searchLength && equals(current[--index1], old[--index2]))\n count++;\n\n return count;\n}\n\n/**\n * Returns an array of splice records indicating the minimum edits required\n * to transform the `previous` array into the `current` array.\n *\n * Splice records are ordered by index and contain the following fields:\n * - `index`: index where edit started\n * - `removed`: array of removed items from this index\n * - `addedCount`: number of items added at this index\n *\n * This function is based on the Levenshtein \"minimum edit distance\"\n * algorithm. Note that updates are treated as removal followed by addition.\n *\n * The worst-case time complexity of this algorithm is `O(l * p)`\n * l: The length of the current array\n * p: The length of the previous array\n *\n * However, the worst-case complexity is reduced by an `O(n)` optimization\n * to detect any shared prefix & suffix between the two arrays and only\n * perform the more expensive minimum edit distance calculation over the\n * non-shared portions of the arrays.\n *\n * @function\n * @param {!Array} current The \"changed\" array for which splices will be\n * calculated.\n * @param {!Array} previous The \"unchanged\" original array to compare\n * `current` against to determine the splices.\n * @return {!Array} Returns an array of splice record objects. Each of these\n * contains: `index` the location where the splice occurred; `removed`\n * the array of removed items from this location; `addedCount` the number\n * of items added at this location.\n */\nexport function calculateSplices(current, previous) {\n return calcSplices(current, 0, current.length, previous, 0,\n previous.length);\n}\n\nfunction equals(currentValue, previousValue) {\n return currentValue === previousValue;\n}\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\n\nimport { calculateSplices } from './array-splice.js';\nimport { microTask } from './async.js';\nimport { wrap } from './wrap.js';\n\n/**\n * Returns true if `node` is a slot element\n * @param {!Node} node Node to test.\n * @return {boolean} Returns true if the given `node` is a slot\n * @private\n */\nfunction isSlot(node) {\n return (node.localName === 'slot');\n}\n\n/**\n * Class that listens for changes (additions or removals) to\n * \"flattened nodes\" on a given `node`. The list of flattened nodes consists\n * of a node's children and, for any children that are `<slot>` elements,\n * the expanded flattened list of `assignedNodes`.\n * For example, if the observed node has children `<a></a><slot></slot><b></b>`\n * and the `<slot>` has one `<div>` assigned to it, then the flattened\n * nodes list is `<a></a><div></div><b></b>`. If the `<slot>` has other\n * `<slot>` elements assigned to it, these are flattened as well.\n *\n * The provided `callback` is called whenever any change to this list\n * of flattened nodes occurs, where an addition or removal of a node is\n * considered a change. The `callback` is called with one argument, an object\n * containing an array of any `addedNodes` and `removedNodes`.\n *\n * Note: the callback is called asynchronous to any changes\n * at a microtask checkpoint. This is because observation is performed using\n * `MutationObserver` and the `<slot>` element's `slotchange` event which\n * are asynchronous.\n *\n * An example:\n * ```js\n * class TestSelfObserve extends PolymerElement {\n * static get is() { return 'test-self-observe';}\n * connectedCallback() {\n * super.connectedCallback();\n * this._observer = new FlattenedNodesObserver(this, (info) => {\n * this.info = info;\n * });\n * }\n * disconnectedCallback() {\n * super.disconnectedCallback();\n * this._observer.disconnect();\n * }\n * }\n * customElements.define(TestSelfObserve.is, TestSelfObserve);\n * ```\n *\n * @summary Class that listens for changes (additions or removals) to\n * \"flattened nodes\" on a given `node`.\n * @implements {PolymerDomApi.ObserveHandle}\n */\nexport let FlattenedNodesObserver = class {\n\n /**\n * Returns the list of flattened nodes for the given `node`.\n * This list consists of a node's children and, for any children\n * that are `<slot>` elements, the expanded flattened list of `assignedNodes`.\n * For example, if the observed node has children `<a></a><slot></slot><b></b>`\n * and the `<slot>` has one `<div>` assigned to it, then the flattened\n * nodes list is `<a></a><div></div><b></b>`. If the `<slot>` has other\n * `<slot>` elements assigned to it, these are flattened as well.\n *\n * @param {!HTMLElement|!HTMLSlotElement} node The node for which to\n * return the list of flattened nodes.\n * @return {!Array<!Node>} The list of flattened nodes for the given `node`.\n * @nocollapse See https://github.com/google/closure-compiler/issues/2763\n */\n // eslint-disable-next-line\n static getFlattenedNodes(node) {\n const wrapped = wrap(node);\n if (isSlot(node)) {\n node = /** @type {!HTMLSlotElement} */(node); // eslint-disable-line no-self-assign\n return wrapped.assignedNodes({flatten: true});\n } else {\n const results = [];\n for (let i = 0; i < wrapped.childNodes.length; i++) {\n const node = wrapped.childNodes[i];\n if (isSlot(node)) {\n const slotNode = /** @type {!HTMLSlotElement} */ (node);\n results.push(...wrap(slotNode).assignedNodes({ flatten: true }));\n } else {\n results.push(node);\n }\n }\n return results;\n }\n }\n\n /**\n * @param {!HTMLElement} target Node on which to listen for changes.\n * @param {?function(this: Element, { target: !HTMLElement, addedNodes: !Array<!Element>, removedNodes: !Array<!Element> }):void} callback Function called when there are additions\n * or removals from the target's list of flattened nodes.\n */\n // eslint-disable-next-line\n constructor(target, callback) {\n /**\n * @type {MutationObserver}\n * @private\n */\n this._shadyChildrenObserver = null;\n /**\n * @type {MutationObserver}\n * @private\n */\n this._nativeChildrenObserver = null;\n this._connected = false;\n /**\n * @type {!HTMLElement}\n * @private\n */\n this._target = target;\n this.callback = callback;\n this._effectiveNodes = [];\n this._observer = null;\n this._scheduled = false;\n /**\n * @type {function()}\n * @private\n */\n this._boundSchedule = () => {\n this._schedule();\n };\n this.connect();\n this._schedule();\n }\n\n /**\n * Activates an observer. This method is automatically called when\n * a `FlattenedNodesObserver` is created. It should only be called to\n * re-activate an observer that has been deactivated via the `disconnect` method.\n *\n * @return {void}\n */\n connect() {\n if (isSlot(this._target)) {\n this._listenSlots([this._target]);\n } else if (wrap(this._target).children) {\n this._listenSlots(\n /** @type {!NodeList<!Node>} */ (wrap(this._target).children));\n if (window.ShadyDOM) {\n this._shadyChildrenObserver =\n window.ShadyDOM.observeChildren(this._target, (mutations) => {\n this._processMutations(mutations);\n });\n } else {\n this._nativeChildrenObserver =\n new MutationObserver((mutations) => {\n this._processMutations(mutations);\n });\n this._nativeChildrenObserver.observe(this._target, {childList: true});\n }\n }\n this._connected = true;\n }\n\n /**\n * Deactivates the flattened nodes observer. After calling this method\n * the observer callback will not be called when changes to flattened nodes\n * occur. The `connect` method may be subsequently called to reactivate\n * the observer.\n *\n * @return {void}\n * @override\n */\n disconnect() {\n if (isSlot(this._target)) {\n this._unlistenSlots([this._target]);\n } else if (wrap(this._target).children) {\n this._unlistenSlots(\n /** @type {!NodeList<!Node>} */ (wrap(this._target).children));\n if (window.ShadyDOM && this._shadyChildrenObserver) {\n window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver);\n this._shadyChildrenObserver = null;\n } else if (this._nativeChildrenObserver) {\n this._nativeChildrenObserver.disconnect();\n this._nativeChildrenObserver = null;\n }\n }\n this._connected = false;\n }\n\n /**\n * @return {void}\n * @private\n */\n _schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n microTask.run(() => this.flush());\n }\n }\n\n /**\n * @param {Array<MutationRecord>} mutations Mutations signaled by the mutation observer\n * @return {void}\n * @private\n */\n _processMutations(mutations) {\n this._processSlotMutations(mutations);\n this.flush();\n }\n\n /**\n * @param {Array<MutationRecord>} mutations Mutations signaled by the mutation observer\n * @return {void}\n * @private\n */\n _processSlotMutations(mutations) {\n if (mutations) {\n for (let i=0; i < mutations.length; i++) {\n let mutation = mutations[i];\n if (mutation.addedNodes) {\n this._listenSlots(mutation.addedNodes);\n }\n if (mutation.removedNodes) {\n this._unlistenSlots(mutation.removedNodes);\n }\n }\n }\n }\n\n /**\n * Flushes the observer causing any pending changes to be immediately\n * delivered the observer callback. By default these changes are delivered\n * asynchronously at the next microtask checkpoint.\n *\n * @return {boolean} Returns true if any pending changes caused the observer\n * callback to run.\n */\n flush() {\n if (!this._connected) {\n return false;\n }\n if (window.ShadyDOM) {\n ShadyDOM.flush();\n }\n if (this._nativeChildrenObserver) {\n this._processSlotMutations(this._nativeChildrenObserver.takeRecords());\n } else if (this._shadyChildrenObserver) {\n this._processSlotMutations(this._shadyChildrenObserver.takeRecords());\n }\n this._scheduled = false;\n let info = {\n target: this._target,\n addedNodes: [],\n removedNodes: []\n };\n let newNodes = this.constructor.getFlattenedNodes(this._target);\n let splices = calculateSplices(newNodes,\n this._effectiveNodes);\n // process removals\n for (let i=0, s; (i<splices.length) && (s=splices[i]); i++) {\n for (let j=0, n; (j < s.removed.length) && (n=s.removed[j]); j++) {\n info.removedNodes.push(n);\n }\n }\n // process adds\n for (let i=0, s; (i<splices.length) && (s=splices[i]); i++) {\n for (let j=s.index; j < s.index + s.addedCount; j++) {\n info.addedNodes.push(newNodes[j]);\n }\n }\n // update cache\n this._effectiveNodes = newNodes;\n let didFlush = false;\n if (info.addedNodes.length || info.removedNodes.length) {\n didFlush = true;\n this.callback.call(this._target, info);\n }\n return didFlush;\n }\n\n /**\n * @param {!Array<!Node>|!NodeList<!Node>} nodeList Nodes that could change\n * @return {void}\n * @private\n */\n _listenSlots(nodeList) {\n for (let i=0; i < nodeList.length; i++) {\n let n = nodeList[i];\n if (isSlot(n)) {\n n.addEventListener('slotchange', this._boundSchedule);\n }\n }\n }\n\n /**\n * @param {!Array<!Node>|!NodeList<!Node>} nodeList Nodes that could change\n * @return {void}\n * @private\n */\n _unlistenSlots(nodeList) {\n for (let i=0; i < nodeList.length; i++) {\n let n = nodeList[i];\n if (isSlot(n)) {\n n.removeEventListener('slotchange', this._boundSchedule);\n }\n }\n }\n\n};\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport './boot.js';\nimport {enqueueDebouncer, flushDebouncers} from '../utils/debounce.js';\nexport {enqueueDebouncer};\n\n/**\n * Forces several classes of asynchronously queued tasks to flush:\n * - Debouncers added via `enqueueDebouncer`\n * - ShadyDOM distribution\n *\n * @return {void}\n */\nexport const flush = function() {\n let shadyDOM, debouncers;\n do {\n shadyDOM = window.ShadyDOM && ShadyDOM.flush();\n if (window.ShadyCSS && window.ShadyCSS.ScopingShim) {\n window.ShadyCSS.ScopingShim.flush();\n }\n debouncers = flushDebouncers();\n } while (shadyDOM || debouncers);\n};\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '../utils/boot.js';\nimport { wrap } from '../utils/wrap.js';\nimport '../utils/settings.js';\nimport { FlattenedNodesObserver } from '../utils/flattened-nodes-observer.js';\nexport { flush, enqueueDebouncer as addDebouncer } from '../utils/flush.js';\n/* eslint-disable no-unused-vars */\nimport { Debouncer } from '../utils/debounce.js'; // used in type annotations\n/* eslint-enable no-unused-vars */\n\nconst p = Element.prototype;\n/**\n * @const {function(this:Node, string): boolean}\n */\nconst normalizedMatchesSelector = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\n/**\n * Cross-platform `element.matches` shim.\n *\n * @function matchesSelector\n * @param {!Node} node Node to check selector against\n * @param {string} selector Selector to match\n * @return {boolean} True if node matched selector\n */\nexport const matchesSelector = function(node, selector) {\n return normalizedMatchesSelector.call(node, selector);\n};\n\n/**\n * Node API wrapper class returned from `Polymer.dom.(target)` when\n * `target` is a `Node`.\n * @implements {PolymerDomApi}\n * @unrestricted\n */\nclass DomApiNative {\n\n /**\n * @param {!Node} node Node for which to create a Polymer.dom helper object.\n */\n constructor(node) {\n if (window['ShadyDOM'] && window['ShadyDOM']['inUse']) {\n window['ShadyDOM']['patch'](node);\n }\n this.node = node;\n }\n\n /**\n * Returns an instance of `FlattenedNodesObserver` that\n * listens for node changes on this element.\n *\n * @param {function(this:HTMLElement, { target: !HTMLElement, addedNodes: !Array<!Element>, removedNodes: !Array<!Element> }):void} callback Called when direct or distributed children\n * of this element changes\n * @return {!PolymerDomApi.ObserveHandle} Observer instance\n * @override\n */\n observeNodes(callback) {\n return new FlattenedNodesObserver(\n /** @type {!HTMLElement} */(this.node), callback);\n }\n\n /**\n * Disconnects an observer previously created via `observeNodes`\n *\n * @param {!PolymerDomApi.ObserveHandle} observerHandle Observer instance\n * to disconnect.\n * @return {void}\n * @override\n */\n unobserveNodes(observerHandle) {\n observerHandle.disconnect();\n }\n\n /**\n * Provided as a backwards-compatible API only. This method does nothing.\n * @return {void}\n */\n notifyObserver() {}\n\n /**\n * Returns true if the provided node is contained with this element's\n * light-DOM children or shadow root, including any nested shadow roots\n * of children therein.\n *\n * @param {Node} node Node to test\n * @return {boolean} Returns true if the given `node` is contained within\n * this element's light or shadow DOM.\n * @override\n */\n deepContains(node) {\n if (wrap(this.node).contains(node)) {\n return true;\n }\n let n = node;\n let doc = node.ownerDocument;\n // walk from node to `this` or `document`\n while (n && n !== doc && n !== this.node) {\n // use logical parentnode, or native ShadowRoot host\n n = wrap(n).parentNode || wrap(n).host;\n }\n return n === this.node;\n }\n\n /**\n * Returns the root node of this node. Equivalent to `getRootNode()`.\n *\n * @return {!Node} Top most element in the dom tree in which the node\n * exists. If the node is connected to a document this is either a\n * shadowRoot or the document; otherwise, it may be the node\n * itself or a node or document fragment containing it.\n * @override\n */\n getOwnerRoot() {\n return wrap(this.node).getRootNode();\n }\n\n /**\n * For slot elements, returns the nodes assigned to the slot; otherwise\n * an empty array. It is equivalent to `<slot>.addignedNodes({flatten:true})`.\n *\n * @return {!Array<!Node>} Array of assigned nodes\n * @override\n */\n getDistributedNodes() {\n return (this.node.localName === 'slot') ?\n wrap(this.node).assignedNodes({flatten: true}) :\n [];\n }\n\n /**\n * Returns an array of all slots this element was distributed to.\n *\n * @return {!Array<!HTMLSlotElement>} Description\n * @override\n */\n getDestinationInsertionPoints() {\n let ip$ = [];\n let n = wrap(this.node).assignedSlot;\n while (n) {\n ip$.push(n);\n n = wrap(n).assignedSlot;\n }\n return ip$;\n }\n\n /**\n * Calls `importNode` on the `ownerDocument` for this node.\n *\n * @param {!Node} node Node to import\n * @param {boolean} deep True if the node should be cloned deeply during\n * import\n * @return {Node} Clone of given node imported to this owner document\n */\n importNode(node, deep) {\n let doc = this.node instanceof Document ? this.node :\n this.node.ownerDocument;\n return wrap(doc).importNode(node, deep);\n }\n\n /**\n * @return {!Array<!Node>} Returns a flattened list of all child nodes and\n * nodes assigned to child slots.\n * @override\n */\n getEffectiveChildNodes() {\n return FlattenedNodesObserver.getFlattenedNodes(\n /** @type {!HTMLElement} */ (this.node));\n }\n\n /**\n * Returns a filtered list of flattened child elements for this element based\n * on the given selector.\n *\n * @param {string} selector Selector to filter nodes against\n * @return {!Array<!HTMLElement>} List of flattened child elements\n * @override\n */\n queryDistributedElements(selector) {\n let c$ = this.getEffectiveChildNodes();\n let list = [];\n for (let i=0, l=c$.length, c; (i<l) && (c=c$[i]); i++) {\n if ((c.nodeType === Node.ELEMENT_NODE) &&\n matchesSelector(c, selector)) {\n list.push(c);\n }\n }\n return list;\n }\n\n /**\n * For shadow roots, returns the currently focused element within this\n * shadow root.\n *\n * return {Node|undefined} Currently focused element\n * @override\n */\n get activeElement() {\n let node = this.node;\n return node._activeElement !== undefined ? node._activeElement : node.activeElement;\n }\n}\n\nfunction forwardMethods(proto, methods) {\n for (let i=0; i < methods.length; i++) {\n let method = methods[i];\n /* eslint-disable valid-jsdoc */\n proto[method] = /** @this {DomApiNative} */ function() {\n return this.node[method].apply(this.node, arguments);\n };\n /* eslint-enable */\n }\n}\n\nfunction forwardReadOnlyProperties(proto, properties) {\n for (let i=0; i < properties.length; i++) {\n let name = properties[i];\n Object.defineProperty(proto, name, {\n get: function() {\n const domApi = /** @type {DomApiNative} */(this);\n return domApi.node[name];\n },\n configurable: true\n });\n }\n}\n\nfunction forwardProperties(proto, properties) {\n for (let i=0; i < properties.length; i++) {\n let name = properties[i];\n Object.defineProperty(proto, name, {\n /**\n * @this {DomApiNative}\n * @return {*} .\n */\n get: function() {\n return this.node[name];\n },\n /**\n * @this {DomApiNative}\n * @param {*} value .\n */\n set: function(value) {\n this.node[name] = value;\n },\n configurable: true\n });\n }\n}\n\n\n/**\n * Event API wrapper class returned from `dom.(target)` when\n * `target` is an `Event`.\n */\nexport class EventApi {\n constructor(event) {\n this.event = event;\n }\n\n /**\n * Returns the first node on the `composedPath` of this event.\n *\n * @return {!EventTarget} The node this event was dispatched to\n */\n get rootTarget() {\n return this.path[0];\n }\n\n /**\n * Returns the local (re-targeted) target for this event.\n *\n * @return {!EventTarget} The local (re-targeted) target for this event.\n */\n get localTarget() {\n return this.event.target;\n }\n\n /**\n * Returns the `composedPath` for this event.\n * @return {!Array<!EventTarget>} The nodes this event propagated through\n */\n get path() {\n return this.event.composedPath();\n }\n}\n\n/**\n * @function\n * @param {boolean=} deep\n * @return {!Node}\n */\nDomApiNative.prototype.cloneNode;\n/**\n * @function\n * @param {!Node} node\n * @return {!Node}\n */\nDomApiNative.prototype.appendChild;\n/**\n * @function\n * @param {!Node} newChild\n * @param {Node} refChild\n * @return {!Node}\n */\nDomApiNative.prototype.insertBefore;\n/**\n * @function\n * @param {!Node} node\n * @return {!Node}\n */\nDomApiNative.prototype.removeChild;\n/**\n * @function\n * @param {!Node} oldChild\n * @param {!Node} newChild\n * @return {!Node}\n */\nDomApiNative.prototype.replaceChild;\n/**\n * @function\n * @param {string} name\n * @param {string} value\n * @return {void}\n */\nDomApiNative.prototype.setAttribute;\n/**\n * @function\n * @param {string} name\n * @return {void}\n */\nDomApiNative.prototype.removeAttribute;\n/**\n * @function\n * @param {string} selector\n * @return {?Element}\n */\nDomApiNative.prototype.querySelector;\n/**\n * @function\n * @param {string} selector\n * @return {!NodeList<!Element>}\n */\nDomApiNative.prototype.querySelectorAll;\n\n/** @type {?Node} */\nDomApiNative.prototype.parentNode;\n/** @type {?Node} */\nDomApiNative.prototype.firstChild;\n/** @type {?Node} */\nDomApiNative.prototype.lastChild;\n/** @type {?Node} */\nDomApiNative.prototype.nextSibling;\n/** @type {?Node} */\nDomApiNative.prototype.previousSibling;\n/** @type {?HTMLElement} */\nDomApiNative.prototype.firstElementChild;\n/** @type {?HTMLElement} */\nDomApiNative.prototype.lastElementChild;\n/** @type {?HTMLElement} */\nDomApiNative.prototype.nextElementSibling;\n/** @type {?HTMLElement} */\nDomApiNative.prototype.previousElementSibling;\n/** @type {!Array<!Node>} */\nDomApiNative.prototype.childNodes;\n/** @type {!Array<!HTMLElement>} */\nDomApiNative.prototype.children;\n/** @type {?DOMTokenList} */\nDomApiNative.prototype.classList;\n\n/** @type {string} */\nDomApiNative.prototype.textContent;\n/** @type {string} */\nDomApiNative.prototype.innerHTML;\n\nlet DomApiImpl = DomApiNative;\n\nif (window['ShadyDOM'] && window['ShadyDOM']['inUse'] && window['ShadyDOM']['noPatch'] && window['ShadyDOM']['Wrapper']) {\n\n /**\n * @private\n * @extends {HTMLElement}\n */\n class Wrapper extends window['ShadyDOM']['Wrapper'] {}\n\n // copy bespoke API onto wrapper\n Object.getOwnPropertyNames(DomApiNative.prototype).forEach((prop) => {\n if (prop != 'activeElement') {\n Wrapper.prototype[prop] = DomApiNative.prototype[prop];\n }\n });\n\n // Note, `classList` is here only for legacy compatibility since it does not\n // trigger distribution in v1 Shadow DOM.\n forwardReadOnlyProperties(Wrapper.prototype, [\n 'classList'\n ]);\n\n DomApiImpl = Wrapper;\n\n Object.defineProperties(EventApi.prototype, {\n\n // Returns the \"lowest\" node in the same root as the event's currentTarget.\n // When in `noPatch` mode, this must be calculated by walking the event's\n // path.\n localTarget: {\n get() {\n const current = this.event.currentTarget;\n const currentRoot = current && dom(current).getOwnerRoot();\n const p$ = this.path;\n for (let i = 0; i < p$.length; i++) {\n const e = p$[i];\n if (dom(e).getOwnerRoot() === currentRoot) {\n return e;\n }\n }\n },\n configurable: true\n },\n\n path: {\n get() {\n return window['ShadyDOM']['composedPath'](this.event);\n },\n configurable: true\n }\n });\n\n} else {\n\n // Methods that can provoke distribution or must return the logical, not\n // composed tree.\n forwardMethods(DomApiNative.prototype, [\n 'cloneNode', 'appendChild', 'insertBefore', 'removeChild',\n 'replaceChild', 'setAttribute', 'removeAttribute',\n 'querySelector', 'querySelectorAll', 'attachShadow'\n ]);\n\n // Properties that should return the logical, not composed tree. Note, `classList`\n // is here only for legacy compatibility since it does not trigger distribution\n // in v1 Shadow DOM.\n forwardReadOnlyProperties(DomApiNative.prototype, [\n 'parentNode', 'firstChild', 'lastChild',\n 'nextSibling', 'previousSibling', 'firstElementChild',\n 'lastElementChild', 'nextElementSibling', 'previousElementSibling',\n 'childNodes', 'children', 'classList', 'shadowRoot'\n ]);\n\n forwardProperties(DomApiNative.prototype, [\n 'textContent', 'innerHTML', 'className'\n ]);\n}\n\nexport const DomApi = DomApiImpl;\n\n/**\n * Legacy DOM and Event manipulation API wrapper factory used to abstract\n * differences between native Shadow DOM and \"Shady DOM\" when polyfilling on\n * older browsers.\n *\n * Note that in Polymer 2.x use of `Polymer.dom` is no longer required and\n * in the majority of cases simply facades directly to the standard native\n * API.\n *\n * @summary Legacy DOM and Event manipulation API wrapper factory used to\n * abstract differences between native Shadow DOM and \"Shady DOM.\"\n * @param {(Node|Event|DomApiNative|EventApi)=} obj Node or event to operate on\n * @return {!DomApiNative|!EventApi} Wrapper providing either node API or event API\n */\nexport const dom = function(obj) {\n obj = obj || document;\n if (obj instanceof DomApiImpl) {\n return /** @type {!DomApi} */(obj);\n }\n if (obj instanceof EventApi) {\n return /** @type {!EventApi} */(obj);\n }\n let helper = obj['__domApi'];\n if (!helper) {\n if (obj instanceof Event) {\n helper = new EventApi(obj);\n } else {\n helper = new DomApiImpl(/** @type {Node} */(obj));\n }\n obj['__domApi'] = helper;\n }\n return helper;\n};\n", "/**\n@license\nCopyright (c) 2019 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport './boot.js';\nimport {wrap} from './wrap.js';\n\nconst ShadyDOM = window.ShadyDOM;\nconst ShadyCSS = window.ShadyCSS;\n\n/**\n * Return true if node scope is correct.\n *\n * @param {!Element} node Node to check scope\n * @param {!Node} scope Scope reference\n * @return {boolean} True if node is in scope\n */\nfunction sameScope(node, scope) {\n return wrap(node).getRootNode() === scope;\n}\n\n/**\n * Ensure that elements in a ShadowDOM container are scoped correctly.\n * This function is only needed when ShadyDOM is used and unpatched DOM APIs are used in third party code.\n * This can happen in noPatch mode or when specialized APIs like ranges or tables are used to mutate DOM.\n *\n * @param {!Element} container Container element to scope\n * @param {boolean=} shouldObserve if true, start a mutation observer for added nodes to the container\n * @return {?MutationObserver} Returns a new MutationObserver on `container` if `shouldObserve` is true.\n */\nexport function scopeSubtree(container, shouldObserve = false) {\n // If using native ShadowDOM, abort\n if (!ShadyDOM || !ShadyCSS) {\n return null;\n }\n // ShadyCSS handles DOM mutations when ShadyDOM does not handle scoping itself\n if (!ShadyDOM['handlesDynamicScoping']) {\n return null;\n }\n const ScopingShim = ShadyCSS['ScopingShim'];\n // if ScopingShim is not available, abort\n if (!ScopingShim) {\n return null;\n }\n // capture correct scope for container\n const containerScope = ScopingShim['scopeForNode'](container);\n const root = wrap(container).getRootNode();\n\n const scopify = (node) => {\n if (!sameScope(node, root)) {\n return;\n }\n // NOTE: native qSA does not honor scoped DOM, but it is faster, and the same behavior as Polymer v1\n const elements = Array.from(ShadyDOM['nativeMethods']['querySelectorAll'].call(node, '*'));\n elements.push(node);\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n if (!sameScope(el, root)) {\n continue;\n }\n const currentScope = ScopingShim['currentScopeForNode'](el);\n if (currentScope !== containerScope) {\n if (currentScope !== '') {\n ScopingShim['unscopeNode'](el, currentScope);\n }\n ScopingShim['scopeNode'](el, containerScope);\n }\n }\n };\n\n // scope everything in container\n scopify(container);\n\n if (shouldObserve) {\n const mo = new MutationObserver((mxns) => {\n for (let i = 0; i < mxns.length; i++) {\n const mxn = mxns[i];\n for (let j = 0; j < mxn.addedNodes.length; j++) {\n const addedNode = mxn.addedNodes[j];\n if (addedNode.nodeType === Node.ELEMENT_NODE) {\n scopify(addedNode);\n }\n }\n }\n });\n mo.observe(container, {childList: true, subtree: true});\n return mo;\n } else {\n return null;\n }\n}", "/**\n * @fileoverview\n * @suppress {checkPrototypalTypes}\n * @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt The complete set of authors may be found\n * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may\n * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by\n * Google as part of the polymer project is also subject to an additional IP\n * rights grant found at http://polymer.github.io/PATENTS.txt\n */\nimport { ElementMixin } from './element-mixin.js';\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { wrap } from '../utils/wrap.js';\n\nconst DISABLED_ATTR = 'disable-upgrade';\n\nexport const findObservedAttributesGetter = (ctor) => {\n while (ctor) {\n const desc = Object.getOwnPropertyDescriptor(ctor, 'observedAttributes');\n if (desc) {\n return desc.get;\n }\n ctor = Object.getPrototypeOf(ctor.prototype).constructor;\n }\n return () => [];\n};\n\n/**\n * Element class mixin that allows the element to boot up in a non-enabled\n * state when the `disable-upgrade` attribute is present. This mixin is\n * designed to be used with element classes like PolymerElement that perform\n * initial startup work when they are first connected. When the\n * `disable-upgrade` attribute is removed, if the element is connected, it\n * boots up and \"enables\" as it otherwise would; if it is not connected, the\n * element boots up when it is next connected.\n *\n * Using `disable-upgrade` with PolymerElement prevents any data propagation\n * to the element, any element DOM from stamping, or any work done in\n * connected/disconnctedCallback from occuring, but it does not prevent work\n * done in the element constructor.\n *\n * Note, this mixin must be applied on top of any element class that\n * itself implements a `connectedCallback` so that it can control the work\n * done in `connectedCallback`. For example,\n *\n * MyClass = DisableUpgradeMixin(class extends BaseClass {...});\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin ElementMixin\n * @template T\n * @param {function(new:T)} superClass Class to apply mixin to.\n * @return {function(new:T)} superClass with mixin applied.\n */\nexport const DisableUpgradeMixin = dedupingMixin((base) => {\n /**\n * @constructor\n * @implements {Polymer_ElementMixin}\n * @extends {HTMLElement}\n * @private\n */\n const superClass = ElementMixin(base);\n\n // Work around for closure bug #126934458. Using `super` in a property\n // getter does not work so instead we search the Base prototype for an\n // implementation of observedAttributes so that we can override and call\n // the `super` getter. Note, this is done one time ever because we assume\n // that `Base` is always comes from `Polymer.LegacyElementMixn`.\n let observedAttributesGetter = findObservedAttributesGetter(superClass);\n\n /**\n * @polymer\n * @mixinClass\n * @implements {Polymer_DisableUpgradeMixin}\n */\n class DisableUpgradeClass extends superClass {\n\n constructor() {\n super();\n /** @type {boolean|undefined} */\n this.__isUpgradeDisabled;\n }\n\n static get observedAttributes() {\n return observedAttributesGetter.call(this).concat(DISABLED_ATTR);\n }\n\n // Prevent element from initializing properties when it's upgrade disabled.\n /** @override */\n _initializeProperties() {\n if (this.hasAttribute(DISABLED_ATTR)) {\n this.__isUpgradeDisabled = true;\n } else {\n super._initializeProperties();\n }\n }\n\n // Prevent element from enabling properties when it's upgrade disabled.\n // Normally overriding connectedCallback would be enough, but dom-* elements\n /** @override */\n _enableProperties() {\n if (!this.__isUpgradeDisabled) {\n super._enableProperties();\n }\n }\n\n // If the element starts upgrade-disabled and a property is set for\n // which an accessor exists, the default should not be applied.\n // This additional check is needed because defaults are applied via\n // `_initializeProperties` which is called after initial properties\n // have been set when the element starts upgrade-disabled.\n /** @override */\n _canApplyPropertyDefault(property) {\n return super._canApplyPropertyDefault(property) &&\n !(this.__isUpgradeDisabled && this._isPropertyPending(property));\n }\n\n /**\n * @override\n * @param {string} name Attribute name.\n * @param {?string} old The previous value for the attribute.\n * @param {?string} value The new value for the attribute.\n * @param {?string} namespace The XML namespace for the attribute.\n * @return {void}\n */\n attributeChangedCallback(name, old, value, namespace) {\n if (name == DISABLED_ATTR) {\n // When disable-upgrade is removed, initialize properties and\n // provoke connectedCallback if the element is already connected.\n if (this.__isUpgradeDisabled && value == null) {\n super._initializeProperties();\n this.__isUpgradeDisabled = false;\n if (wrap(this).isConnected) {\n super.connectedCallback();\n }\n }\n } else {\n super.attributeChangedCallback(\n name, old, value, /** @type {null|string} */ (namespace));\n }\n }\n\n // Prevent element from connecting when it's upgrade disabled.\n // This prevents user code in `attached` from being called.\n /** @override */\n connectedCallback() {\n if (!this.__isUpgradeDisabled) {\n super.connectedCallback();\n }\n }\n\n // Prevent element from disconnecting when it's upgrade disabled.\n // This avoids allowing user code `detached` from being called without a\n // paired call to `attached`.\n /** @override */\n disconnectedCallback() {\n if (!this.__isUpgradeDisabled) {\n super.disconnectedCallback();\n }\n }\n\n }\n\n return DisableUpgradeClass;\n});\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport '@webcomponents/shadycss/entrypoints/apply-shim.js';\nimport { ElementMixin, builtCSS } from '../mixins/element-mixin.js';\nimport { GestureEventListeners } from '../mixins/gesture-event-listeners.js';\nimport { DirMixin } from '../mixins/dir-mixin.js';\nimport { dedupingMixin } from '../utils/mixin.js';\nimport '../utils/render-status.js';\nimport '../utils/unresolved.js';\nimport { dom, matchesSelector } from './polymer.dom.js';\nimport { setTouchAction } from '../utils/gestures.js';\nimport { Debouncer } from '../utils/debounce.js';\nimport { timeOut, microTask } from '../utils/async.js';\nimport { get } from '../utils/path.js';\nimport { wrap } from '../utils/wrap.js';\nimport { scopeSubtree } from '../utils/scope-subtree.js';\nimport { legacyOptimizations, legacyNoObservedAttributes } from '../utils/settings.js';\nimport { findObservedAttributesGetter } from '../mixins/disable-upgrade-mixin.js';\nimport { register } from '../utils/telemetry.js';\n\nconst DISABLED_ATTR = 'disable-upgrade';\n\nlet styleInterface = window.ShadyCSS;\n\n/**\n * Element class mixin that provides Polymer's \"legacy\" API intended to be\n * backward-compatible to the greatest extent possible with the API\n * found on the Polymer 1.x `Polymer.Base` prototype applied to all elements\n * defined using the `Polymer({...})` function.\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin ElementMixin\n * @appliesMixin GestureEventListeners\n * @appliesMixin DirMixin\n * @property isAttached {boolean} Set to `true` in this element's\n * `connectedCallback` and `false` in `disconnectedCallback`\n * @summary Element class mixin that provides Polymer's \"legacy\" API\n */\nexport const LegacyElementMixin = dedupingMixin((base) => {\n\n // TODO(kschaaf): Note, the `@implements {Polymer_DirMixin}` is required here\n // (rather than on legacyElementBase) for unknown reasons.\n /**\n * @constructor\n * @implements {Polymer_ElementMixin}\n * @implements {Polymer_GestureEventListeners}\n * @implements {Polymer_DirMixin}\n * @extends {HTMLElement}\n * @private\n */\n const GesturesElement = GestureEventListeners(ElementMixin(base));\n\n // Note, the DirMixin does nothing if css is built so avoid including it\n // in that case.\n\n /**\n * @constructor\n * @extends {GesturesElement}\n * @private\n */\n const legacyElementBase = builtCSS ? GesturesElement :\n DirMixin(GesturesElement);\n\n const observedAttributesGetter = findObservedAttributesGetter(legacyElementBase);\n\n /**\n * Map of simple names to touch action names\n * @dict\n */\n const DIRECTION_MAP = {\n 'x': 'pan-x',\n 'y': 'pan-y',\n 'none': 'none',\n 'all': 'auto'\n };\n\n /**\n * @polymer\n * @mixinClass\n * @extends {legacyElementBase}\n * @implements {Polymer_LegacyElementMixin}\n * @unrestricted\n */\n class LegacyElement extends legacyElementBase {\n\n constructor() {\n super();\n /** @type {boolean} */\n this.isAttached;\n /** @type {?WeakMap<!Element, !Object<string, !Function>>} */\n this.__boundListeners;\n /** @type {?Object<string, ?Function>} */\n this._debouncers;\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n /** @type {boolean|undefined} */\n this.__isUpgradeDisabled;\n /** @type {boolean|undefined} */\n this.__needsAttributesAtConnected;\n /** @type {boolean|undefined} */\n this._legacyForceObservedAttributes;\n }\n\n /**\n * Forwards `importMeta` from the prototype (i.e. from the info object\n * passed to `Polymer({...})`) to the static API.\n *\n * @return {!Object} The `import.meta` object set on the prototype\n * @suppress {missingProperties} `this` is always in the instance in\n * closure for some reason even in a static method, rather than the class\n * @nocollapse\n */\n static get importMeta() {\n return this.prototype.importMeta;\n }\n\n /**\n * Legacy callback called during the `constructor`, for overriding\n * by the user.\n * @override\n * @return {void}\n */\n created() {}\n\n /**\n * Processes an attribute reaction when the `legacyNoObservedAttributes`\n * setting is in use.\n * @param {string} name Name of attribute that changed\n * @param {?string} old Old attribute value\n * @param {?string} value New attribute value\n * @return {void}\n */\n __attributeReaction(name, old, value) {\n if ((this.__dataAttributes && this.__dataAttributes[name]) || name === DISABLED_ATTR) {\n this.attributeChangedCallback(name, old, value, null);\n }\n }\n\n /**\n * Sets the value of an attribute.\n * @override\n */\n setAttribute(name, value) {\n if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {\n const oldValue = this.getAttribute(name);\n super.setAttribute(name, value);\n // value coerced to String for closure's benefit\n this.__attributeReaction(name, oldValue, String(value));\n } else {\n super.setAttribute(name, value);\n }\n }\n\n /**\n * Removes an attribute.\n * @override\n */\n removeAttribute(name) {\n if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {\n const oldValue = this.getAttribute(name);\n super.removeAttribute(name);\n this.__attributeReaction(name, oldValue, null);\n } else {\n super.removeAttribute(name);\n }\n }\n\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n static get observedAttributes() {\n if (legacyNoObservedAttributes && !this.prototype._legacyForceObservedAttributes) {\n // Ensure this element is property registered with the telemetry system.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('__observedAttributes', this))) {\n this.__observedAttributes = [];\n register(this.prototype);\n }\n return this.__observedAttributes;\n } else {\n return observedAttributesGetter.call(this).concat(DISABLED_ATTR);\n }\n }\n\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n // Prevent element from enabling properties when it's upgrade disabled.\n // Normally overriding connectedCallback would be enough, but dom-* elements\n /** @override */\n _enableProperties() {\n if (!this.__isUpgradeDisabled) {\n super._enableProperties();\n }\n }\n\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n // If the element starts upgrade-disabled and a property is set for\n // which an accessor exists, the default should not be applied.\n // This additional check is needed because defaults are applied via\n // `_initializeProperties` which is called after initial properties\n // have been set when the element starts upgrade-disabled.\n /** @override */\n _canApplyPropertyDefault(property) {\n return super._canApplyPropertyDefault(property) &&\n !(this.__isUpgradeDisabled && this._isPropertyPending(property));\n }\n\n /**\n * Provides an implementation of `connectedCallback`\n * which adds Polymer legacy API's `attached` method.\n * @return {void}\n * @override\n */\n connectedCallback() {\n if (this.__needsAttributesAtConnected) {\n this._takeAttributes();\n }\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n if (!this.__isUpgradeDisabled) {\n super.connectedCallback();\n this.isAttached = true;\n this.attached();\n }\n }\n\n /**\n * Legacy callback called during `connectedCallback`, for overriding\n * by the user.\n * @override\n * @return {void}\n */\n attached() {}\n\n /**\n * Provides an implementation of `disconnectedCallback`\n * which adds Polymer legacy API's `detached` method.\n * @return {void}\n * @override\n */\n disconnectedCallback() {\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n if (!this.__isUpgradeDisabled) {\n super.disconnectedCallback();\n this.isAttached = false;\n this.detached();\n }\n }\n\n /**\n * Legacy callback called during `disconnectedCallback`, for overriding\n * by the user.\n * @override\n * @return {void}\n */\n detached() {}\n\n /**\n * Provides an override implementation of `attributeChangedCallback`\n * which adds the Polymer legacy API's `attributeChanged` method.\n * @param {string} name Name of attribute.\n * @param {?string} old Old value of attribute.\n * @param {?string} value Current value of attribute.\n * @param {?string} namespace Attribute namespace.\n * @return {void}\n * @override\n */\n attributeChangedCallback(name, old, value, namespace) {\n if (old !== value) {\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n if (name == DISABLED_ATTR) {\n // When disable-upgrade is removed, intialize properties and\n // provoke connectedCallback if the element is already connected.\n if (this.__isUpgradeDisabled && value == null) {\n this._initializeProperties();\n this.__isUpgradeDisabled = false;\n if (wrap(this).isConnected) {\n this.connectedCallback();\n }\n }\n } else {\n super.attributeChangedCallback(name, old, value, namespace);\n this.attributeChanged(name, old, value);\n }\n }\n }\n\n /**\n * Legacy callback called during `attributeChangedChallback`, for overriding\n * by the user.\n * @param {string} name Name of attribute.\n * @param {?string} old Old value of attribute.\n * @param {?string} value Current value of attribute.\n * @return {void}\n * @override\n */\n attributeChanged(name, old, value) {} // eslint-disable-line no-unused-vars\n\n /**\n * Overrides the default `Polymer.PropertyEffects` implementation to\n * add support for class initialization via the `_registered` callback.\n * This is called only when the first instance of the element is created.\n *\n * @return {void}\n * @override\n * @suppress {invalidCasts}\n */\n _initializeProperties() {\n // NOTE: Inlined for perf from version of DisableUpgradeMixin.\n // Only auto-use disable-upgrade if legacyOptimizations is set.\n if (legacyOptimizations && this.hasAttribute(DISABLED_ATTR)) {\n this.__isUpgradeDisabled = true;\n } else {\n let proto = Object.getPrototypeOf(this);\n if (!proto.hasOwnProperty(JSCompiler_renameProperty('__hasRegisterFinished', proto))) {\n this._registered();\n // backstop in case the `_registered` implementation does not set this\n proto.__hasRegisterFinished = true;\n }\n super._initializeProperties();\n this.root = /** @type {HTMLElement} */(this);\n this.created();\n // Pull all attribute values 1x if `legacyNoObservedAttributes` is set.\n if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {\n if (this.hasAttributes()) {\n this._takeAttributes();\n // Element created from scratch or parser generated\n } else if (!this.parentNode) {\n this.__needsAttributesAtConnected = true;\n }\n }\n // Ensure listeners are applied immediately so that they are\n // added before declarative event listeners. This allows an element to\n // decorate itself via an event prior to any declarative listeners\n // seeing the event. Note, this ensures compatibility with 1.x ordering.\n this._applyListeners();\n }\n }\n\n _takeAttributes() {\n const a = this.attributes;\n for (let i=0, l=a.length; i < l; i++) {\n const attr = a[i];\n this.__attributeReaction(attr.name, null, attr.value);\n }\n }\n\n /**\n * Called automatically when an element is initializing.\n * Users may override this method to perform class registration time\n * work. The implementation should ensure the work is performed\n * only once for the class.\n * @protected\n * @return {void}\n * @override\n */\n _registered() {}\n\n /**\n * Overrides the default `Polymer.PropertyEffects` implementation to\n * add support for installing `hostAttributes` and `listeners`.\n *\n * @return {void}\n * @override\n */\n ready() {\n this._ensureAttributes();\n super.ready();\n }\n\n /**\n * Ensures an element has required attributes. Called when the element\n * is being readied via `ready`. Users should override to set the\n * element's required attributes. The implementation should be sure\n * to check and not override existing attributes added by\n * the user of the element. Typically, setting attributes should be left\n * to the element user and not done here; reasonable exceptions include\n * setting aria roles and focusability.\n * @protected\n * @return {void}\n * @override\n */\n _ensureAttributes() {}\n\n /**\n * Adds element event listeners. Called when the element\n * is being readied via `ready`. Users should override to\n * add any required element event listeners.\n * In performance critical elements, the work done here should be kept\n * to a minimum since it is done before the element is rendered. In\n * these elements, consider adding listeners asynchronously so as not to\n * block render.\n * @protected\n * @return {void}\n * @override\n */\n _applyListeners() {}\n\n /**\n * Converts a typed JavaScript value to a string.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features. To customize\n * how properties are serialized to attributes for attribute bindings and\n * `reflectToAttribute: true` properties as well as this method, override\n * the `_serializeValue` method provided by `Polymer.PropertyAccessors`.\n *\n * @param {*} value Value to deserialize\n * @return {string | undefined} Serialized value\n * @override\n */\n serialize(value) {\n return this._serializeValue(value);\n }\n\n /**\n * Converts a string to a typed JavaScript value.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features. To customize\n * how attributes are deserialized to properties for in\n * `attributeChangedCallback`, override `_deserializeValue` method\n * provided by `Polymer.PropertyAccessors`.\n *\n * @param {string} value String to deserialize\n * @param {*} type Type to deserialize the string to\n * @return {*} Returns the deserialized value in the `type` given.\n * @override\n */\n deserialize(value, type) {\n return this._deserializeValue(value, type);\n }\n\n /**\n * Serializes a property to its associated attribute.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features.\n *\n * @param {string} property Property name to reflect.\n * @param {string=} attribute Attribute name to reflect.\n * @param {*=} value Property value to reflect.\n * @return {void}\n * @override\n */\n reflectPropertyToAttribute(property, attribute, value) {\n this._propertyToAttribute(property, attribute, value);\n }\n\n /**\n * Sets a typed value to an HTML attribute on a node.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features.\n *\n * @param {*} value Value to serialize.\n * @param {string} attribute Attribute name to serialize to.\n * @param {Element} node Element to set attribute to.\n * @return {void}\n * @override\n */\n serializeValueToAttribute(value, attribute, node) {\n this._valueToNodeAttribute(/** @type {Element} */ (node || this), value, attribute);\n }\n\n /**\n * Copies own properties (including accessor descriptors) from a source\n * object to a target object.\n *\n * @param {Object} prototype Target object to copy properties to.\n * @param {Object} api Source object to copy properties from.\n * @return {Object} prototype object that was passed as first argument.\n * @override\n */\n extend(prototype, api) {\n if (!(prototype && api)) {\n return prototype || api;\n }\n let n$ = Object.getOwnPropertyNames(api);\n for (let i=0, n; (i<n$.length) && (n=n$[i]); i++) {\n let pd = Object.getOwnPropertyDescriptor(api, n);\n if (pd) {\n Object.defineProperty(prototype, n, pd);\n }\n }\n return prototype;\n }\n\n /**\n * Copies props from a source object to a target object.\n *\n * Note, this method uses a simple `for...in` strategy for enumerating\n * properties. To ensure only `ownProperties` are copied from source\n * to target and that accessor implementations are copied, use `extend`.\n *\n * @param {!Object} target Target object to copy properties to.\n * @param {!Object} source Source object to copy properties from.\n * @return {!Object} Target object that was passed as first argument.\n * @override\n */\n mixin(target, source) {\n for (let i in source) {\n target[i] = source[i];\n }\n return target;\n }\n\n /**\n * Sets the prototype of an object.\n *\n * Note this method is provided as backward-compatible legacy API\n * only. It is not directly called by any Polymer features.\n * @param {Object} object The object on which to set the prototype.\n * @param {Object} prototype The prototype that will be set on the given\n * `object`.\n * @return {Object} Returns the given `object` with its prototype set\n * to the given `prototype` object.\n * @override\n */\n chainObject(object, prototype) {\n if (object && prototype && object !== prototype) {\n object.__proto__ = prototype;\n }\n return object;\n }\n\n /* **** Begin Template **** */\n\n /**\n * Calls `importNode` on the `content` of the `template` specified and\n * returns a document fragment containing the imported content.\n *\n * @param {HTMLTemplateElement} template HTML template element to instance.\n * @return {!DocumentFragment} Document fragment containing the imported\n * template content.\n * @override\n * @suppress {missingProperties} go/missingfnprops\n */\n instanceTemplate(template) {\n let content = this.constructor._contentForTemplate(template);\n let dom = /** @type {!DocumentFragment} */\n (document.importNode(content, true));\n return dom;\n }\n\n /* **** Begin Events **** */\n\n\n\n /**\n * Dispatches a custom event with an optional detail value.\n *\n * @param {string} type Name of event type.\n * @param {*=} detail Detail value containing event-specific\n * payload.\n * @param {{ bubbles: (boolean|undefined), cancelable: (boolean|undefined),\n * composed: (boolean|undefined) }=}\n * options Object specifying options. These may include:\n * `bubbles` (boolean, defaults to `true`),\n * `cancelable` (boolean, defaults to false), and\n * `node` on which to fire the event (HTMLElement, defaults to `this`).\n * @return {!Event} The new event that was fired.\n * @override\n */\n fire(type, detail, options) {\n options = options || {};\n detail = (detail === null || detail === undefined) ? {} : detail;\n let event = new Event(type, {\n bubbles: options.bubbles === undefined ? true : options.bubbles,\n cancelable: Boolean(options.cancelable),\n composed: options.composed === undefined ? true: options.composed\n });\n event.detail = detail;\n let node = options.node || this;\n wrap(node).dispatchEvent(event);\n return event;\n }\n\n /**\n * Convenience method to add an event listener on a given element,\n * late bound to a named method on this element.\n *\n * @param {?EventTarget} node Element to add event listener to.\n * @param {string} eventName Name of event to listen for.\n * @param {string} methodName Name of handler method on `this` to call.\n * @return {void}\n * @override\n */\n listen(node, eventName, methodName) {\n node = /** @type {!EventTarget} */ (node || this);\n let hbl = this.__boundListeners ||\n (this.__boundListeners = new WeakMap());\n let bl = hbl.get(node);\n if (!bl) {\n bl = {};\n hbl.set(node, bl);\n }\n let key = eventName + methodName;\n if (!bl[key]) {\n bl[key] = this._addMethodEventListenerToNode(\n /** @type {!Node} */ (node), eventName, methodName, this);\n }\n }\n\n /**\n * Convenience method to remove an event listener from a given element,\n * late bound to a named method on this element.\n *\n * @param {?EventTarget} node Element to remove event listener from.\n * @param {string} eventName Name of event to stop listening to.\n * @param {string} methodName Name of handler method on `this` to not call\n anymore.\n * @return {void}\n * @override\n */\n unlisten(node, eventName, methodName) {\n node = /** @type {!EventTarget} */ (node || this);\n let bl = this.__boundListeners &&\n this.__boundListeners.get(/** @type {!Element} */ (node));\n let key = eventName + methodName;\n let handler = bl && bl[key];\n if (handler) {\n this._removeEventListenerFromNode(\n /** @type {!Node} */ (node), eventName, handler);\n bl[key] = /** @type {?} */ (null);\n }\n }\n\n /**\n * Override scrolling behavior to all direction, one direction, or none.\n *\n * Valid scroll directions:\n * - 'all': scroll in any direction\n * - 'x': scroll only in the 'x' direction\n * - 'y': scroll only in the 'y' direction\n * - 'none': disable scrolling for this node\n *\n * @param {string=} direction Direction to allow scrolling\n * Defaults to `all`.\n * @param {Element=} node Element to apply scroll direction setting.\n * Defaults to `this`.\n * @return {void}\n * @override\n */\n setScrollDirection(direction, node) {\n setTouchAction(\n /** @type {!Element} */ (node || this),\n DIRECTION_MAP[direction] || 'auto');\n }\n /* **** End Events **** */\n\n /**\n * Convenience method to run `querySelector` on this local DOM scope.\n *\n * This function calls `Polymer.dom(this.root).querySelector(slctr)`.\n *\n * @param {string} slctr Selector to run on this local DOM scope\n * @return {Element} Element found by the selector, or null if not found.\n * @override\n */\n $$(slctr) {\n // Note, no need to `wrap` this because root is always patched\n return this.root.querySelector(slctr);\n }\n\n /**\n * Return the element whose local dom within which this element\n * is contained. This is a shorthand for\n * `this.getRootNode().host`.\n * @this {Element}\n * @return {?Node} The element whose local dom within which this element is\n * contained.\n * @override\n */\n get domHost() {\n let root = wrap(this).getRootNode();\n return (root instanceof DocumentFragment) ? /** @type {ShadowRoot} */ (root).host : root;\n }\n\n /**\n * Force this element to distribute its children to its local dom.\n * This should not be necessary as of Polymer 2.0.2 and is provided only\n * for backwards compatibility.\n * @return {void}\n * @override\n */\n distributeContent() {\n const thisEl = /** @type {Element} */ (this);\n const domApi = /** @type {PolymerDomApi} */(dom(thisEl));\n if (window.ShadyDOM && domApi.shadowRoot) {\n ShadyDOM.flush();\n }\n }\n\n /**\n * Returns a list of nodes that are the effective childNodes. The effective\n * childNodes list is the same as the element's childNodes except that\n * any `<content>` elements are replaced with the list of nodes distributed\n * to the `<content>`, the result of its `getDistributedNodes` method.\n * @return {!Array<!Node>} List of effective child nodes.\n * @suppress {invalidCasts} LegacyElementMixin must be applied to an\n * HTMLElement\n * @override\n */\n getEffectiveChildNodes() {\n const thisEl = /** @type {Element} */ (this);\n const domApi = /** @type {PolymerDomApi} */ (dom(thisEl));\n return domApi.getEffectiveChildNodes();\n }\n\n /**\n * Returns a list of nodes distributed within this element that match\n * `selector`. These can be dom children or elements distributed to\n * children that are insertion points.\n * @param {string} selector Selector to run.\n * @return {!Array<!Node>} List of distributed elements that match selector.\n * @suppress {invalidCasts} LegacyElementMixin must be applied to an\n * HTMLElement\n * @override\n */\n queryDistributedElements(selector) {\n const thisEl = /** @type {Element} */ (this);\n const domApi = /** @type {PolymerDomApi} */ (dom(thisEl));\n return domApi.queryDistributedElements(selector);\n }\n\n /**\n * Returns a list of elements that are the effective children. The effective\n * children list is the same as the element's children except that\n * any `<content>` elements are replaced with the list of elements\n * distributed to the `<content>`.\n *\n * @return {!Array<!Node>} List of effective children.\n * @override\n */\n getEffectiveChildren() {\n let list = this.getEffectiveChildNodes();\n return list.filter(function(/** @type {!Node} */ n) {\n return (n.nodeType === Node.ELEMENT_NODE);\n });\n }\n\n /**\n * Returns a string of text content that is the concatenation of the\n * text content's of the element's effective childNodes (the elements\n * returned by <a href=\"#getEffectiveChildNodes>getEffectiveChildNodes</a>.\n *\n * @return {string} List of effective children.\n * @override\n */\n getEffectiveTextContent() {\n let cn = this.getEffectiveChildNodes();\n let tc = [];\n for (let i=0, c; (c = cn[i]); i++) {\n if (c.nodeType !== Node.COMMENT_NODE) {\n tc.push(c.textContent);\n }\n }\n return tc.join('');\n }\n\n /**\n * Returns the first effective childNode within this element that\n * match `selector`. These can be dom child nodes or elements distributed\n * to children that are insertion points.\n * @param {string} selector Selector to run.\n * @return {Node} First effective child node that matches selector.\n * @override\n */\n queryEffectiveChildren(selector) {\n let e$ = this.queryDistributedElements(selector);\n return e$ && e$[0];\n }\n\n /**\n * Returns a list of effective childNodes within this element that\n * match `selector`. These can be dom child nodes or elements distributed\n * to children that are insertion points.\n * @param {string} selector Selector to run.\n * @return {!Array<!Node>} List of effective child nodes that match\n * selector.\n * @override\n */\n queryAllEffectiveChildren(selector) {\n return this.queryDistributedElements(selector);\n }\n\n /**\n * Returns a list of nodes distributed to this element's `<slot>`.\n *\n * If this element contains more than one `<slot>` in its local DOM,\n * an optional selector may be passed to choose the desired content.\n *\n * @param {string=} slctr CSS selector to choose the desired\n * `<slot>`. Defaults to `content`.\n * @return {!Array<!Node>} List of distributed nodes for the `<slot>`.\n * @override\n */\n getContentChildNodes(slctr) {\n // Note, no need to `wrap` this because root is always\n let content = this.root.querySelector(slctr || 'slot');\n return content ?\n /** @type {PolymerDomApi} */ (dom(content)).getDistributedNodes() :\n [];\n }\n\n /**\n * Returns a list of element children distributed to this element's\n * `<slot>`.\n *\n * If this element contains more than one `<slot>` in its\n * local DOM, an optional selector may be passed to choose the desired\n * content. This method differs from `getContentChildNodes` in that only\n * elements are returned.\n *\n * @param {string=} slctr CSS selector to choose the desired\n * `<content>`. Defaults to `content`.\n * @return {!Array<!HTMLElement>} List of distributed nodes for the\n * `<slot>`.\n * @suppress {invalidCasts}\n * @override\n */\n getContentChildren(slctr) {\n let children = /** @type {!Array<!HTMLElement>} */(this.getContentChildNodes(slctr).filter(function(n) {\n return (n.nodeType === Node.ELEMENT_NODE);\n }));\n return children;\n }\n\n /**\n * Checks whether an element is in this element's light DOM tree.\n *\n * @param {?Node} node The element to be checked.\n * @return {boolean} true if node is in this element's light DOM tree.\n * @suppress {invalidCasts} LegacyElementMixin must be applied to an\n * HTMLElement\n * @override\n */\n isLightDescendant(node) {\n const thisNode = /** @type {Node} */ (this);\n return thisNode !== node && wrap(thisNode).contains(node) &&\n wrap(thisNode).getRootNode() === wrap(node).getRootNode();\n }\n\n /**\n * Checks whether an element is in this element's local DOM tree.\n *\n * @param {!Element} node The element to be checked.\n * @return {boolean} true if node is in this element's local DOM tree.\n * @override\n */\n isLocalDescendant(node) {\n return this.root === wrap(node).getRootNode();\n }\n\n /**\n * No-op for backwards compatibility. This should now be handled by\n * ShadyCss library.\n * @param {!Element} container Container element to scope\n * @param {boolean=} shouldObserve if true, start a mutation observer for added nodes to the container\n * @return {?MutationObserver} Returns a new MutationObserver on `container` if `shouldObserve` is true.\n * @override\n */\n scopeSubtree(container, shouldObserve = false) {\n return scopeSubtree(container, shouldObserve);\n }\n\n /**\n * Returns the computed style value for the given property.\n * @param {string} property The css property name.\n * @return {string} Returns the computed css property value for the given\n * `property`.\n * @suppress {invalidCasts} LegacyElementMixin must be applied to an\n * HTMLElement\n * @override\n */\n getComputedStyleValue(property) {\n return styleInterface.getComputedStyleValue(/** @type {!Element} */(this), property);\n }\n\n // debounce\n\n /**\n * Call `debounce` to collapse multiple requests for a named task into\n * one invocation which is made after the wait time has elapsed with\n * no new request. If no wait time is given, the callback will be called\n * at microtask timing (guaranteed before paint).\n *\n * debouncedClickAction(e) {\n * // will not call `processClick` more than once per 100ms\n * this.debounce('click', function() {\n * this.processClick();\n * } 100);\n * }\n *\n * @param {string} jobName String to identify the debounce job.\n * @param {function():void} callback Function that is called (with `this`\n * context) when the wait time elapses.\n * @param {number=} wait Optional wait time in milliseconds (ms) after the\n * last signal that must elapse before invoking `callback`\n * @return {!Object} Returns a debouncer object on which exists the\n * following methods: `isActive()` returns true if the debouncer is\n * active; `cancel()` cancels the debouncer if it is active;\n * `flush()` immediately invokes the debounced callback if the debouncer\n * is active.\n * @override\n */\n debounce(jobName, callback, wait) {\n this._debouncers = this._debouncers || {};\n return this._debouncers[jobName] = Debouncer.debounce(\n this._debouncers[jobName]\n , wait > 0 ? timeOut.after(wait) : microTask\n , callback.bind(this));\n }\n\n /**\n * Returns whether a named debouncer is active.\n *\n * @param {string} jobName The name of the debouncer started with `debounce`\n * @return {boolean} Whether the debouncer is active (has not yet fired).\n * @override\n */\n isDebouncerActive(jobName) {\n this._debouncers = this._debouncers || {};\n let debouncer = this._debouncers[jobName];\n return !!(debouncer && debouncer.isActive());\n }\n\n /**\n * Immediately calls the debouncer `callback` and inactivates it.\n *\n * @param {string} jobName The name of the debouncer started with `debounce`\n * @return {void}\n * @override\n */\n flushDebouncer(jobName) {\n this._debouncers = this._debouncers || {};\n let debouncer = this._debouncers[jobName];\n if (debouncer) {\n debouncer.flush();\n }\n }\n\n /**\n * Cancels an active debouncer. The `callback` will not be called.\n *\n * @param {string} jobName The name of the debouncer started with `debounce`\n * @return {void}\n * @override\n */\n cancelDebouncer(jobName) {\n this._debouncers = this._debouncers || {};\n let debouncer = this._debouncers[jobName];\n if (debouncer) {\n debouncer.cancel();\n }\n }\n\n /**\n * Runs a callback function asynchronously.\n *\n * By default (if no waitTime is specified), async callbacks are run at\n * microtask timing, which will occur before paint.\n *\n * @param {!Function} callback The callback function to run, bound to\n * `this`.\n * @param {number=} waitTime Time to wait before calling the\n * `callback`. If unspecified or 0, the callback will be run at microtask\n * timing (before paint).\n * @return {number} Handle that may be used to cancel the async job.\n * @override\n */\n async(callback, waitTime) {\n return waitTime > 0 ? timeOut.run(callback.bind(this), waitTime) :\n ~microTask.run(callback.bind(this));\n }\n\n /**\n * Cancels an async operation started with `async`.\n *\n * @param {number} handle Handle returned from original `async` call to\n * cancel.\n * @return {void}\n * @override\n */\n cancelAsync(handle) {\n handle < 0 ? microTask.cancel(~handle) :\n timeOut.cancel(handle);\n }\n\n // other\n\n /**\n * Convenience method for creating an element and configuring it.\n *\n * @param {string} tag HTML element tag to create.\n * @param {Object=} props Object of properties to configure on the\n * instance.\n * @return {!Element} Newly created and configured element.\n * @override\n */\n create(tag, props) {\n let elt = document.createElement(tag);\n if (props) {\n if (elt.setProperties) {\n elt.setProperties(props);\n } else {\n for (let n in props) {\n elt[n] = props[n];\n }\n }\n }\n return elt;\n }\n\n /**\n * Polyfill for Element.prototype.matches, which is sometimes still\n * prefixed.\n *\n * @param {string} selector Selector to test.\n * @param {!Element=} node Element to test the selector against.\n * @return {boolean} Whether the element matches the selector.\n * @override\n */\n elementMatches(selector, node) {\n return matchesSelector( (node || this), selector);\n }\n\n /**\n * Toggles an HTML attribute on or off.\n *\n * @param {string} name HTML attribute name\n * @param {boolean=} bool Boolean to force the attribute on or off.\n * When unspecified, the state of the attribute will be reversed.\n * @return {boolean} true if the attribute now exists\n * @override\n */\n toggleAttribute(name, bool) {\n let node = /** @type {Element} */(this);\n if (arguments.length === 3) {\n node = /** @type {Element} */(arguments[2]);\n }\n if (arguments.length == 1) {\n bool = !node.hasAttribute(name);\n }\n if (bool) {\n wrap(node).setAttribute(name, '');\n return true;\n } else {\n wrap(node).removeAttribute(name);\n return false;\n }\n }\n\n\n /**\n * Toggles a CSS class on or off.\n *\n * @param {string} name CSS class name\n * @param {boolean=} bool Boolean to force the class on or off.\n * When unspecified, the state of the class will be reversed.\n * @param {Element=} node Node to target. Defaults to `this`.\n * @return {void}\n * @override\n */\n toggleClass(name, bool, node) {\n node = /** @type {Element} */ (node || this);\n if (arguments.length == 1) {\n bool = !node.classList.contains(name);\n }\n if (bool) {\n node.classList.add(name);\n } else {\n node.classList.remove(name);\n }\n }\n\n /**\n * Cross-platform helper for setting an element's CSS `transform` property.\n *\n * @param {string} transformText Transform setting.\n * @param {Element=} node Element to apply the transform to.\n * Defaults to `this`\n * @return {void}\n * @override\n */\n transform(transformText, node) {\n node = /** @type {Element} */ (node || this);\n node.style.webkitTransform = transformText;\n node.style.transform = transformText;\n }\n\n /**\n * Cross-platform helper for setting an element's CSS `translate3d`\n * property.\n *\n * @param {number|string} x X offset.\n * @param {number|string} y Y offset.\n * @param {number|string} z Z offset.\n * @param {Element=} node Element to apply the transform to.\n * Defaults to `this`.\n * @return {void}\n * @override\n */\n translate3d(x, y, z, node) {\n node = /** @type {Element} */ (node || this);\n this.transform('translate3d(' + x + ',' + y + ',' + z + ')', node);\n }\n\n /**\n * Removes an item from an array, if it exists.\n *\n * If the array is specified by path, a change notification is\n * generated, so that observers, data bindings and computed\n * properties watching that path can update.\n *\n * If the array is passed directly, **no change\n * notification is generated**.\n *\n * @param {string | !Array<number|string>} arrayOrPath Path to array from\n * which to remove the item\n * (or the array itself).\n * @param {*} item Item to remove.\n * @return {Array} Array containing item removed.\n * @override\n */\n arrayDelete(arrayOrPath, item) {\n let index;\n if (Array.isArray(arrayOrPath)) {\n index = arrayOrPath.indexOf(item);\n if (index >= 0) {\n return arrayOrPath.splice(index, 1);\n }\n } else {\n let arr = get(this, arrayOrPath);\n index = arr.indexOf(item);\n if (index >= 0) {\n return this.splice(arrayOrPath, index, 1);\n }\n }\n return null;\n }\n\n // logging\n\n /**\n * Facades `console.log`/`warn`/`error` as override point.\n *\n * @param {string} level One of 'log', 'warn', 'error'\n * @param {Array} args Array of strings or objects to log\n * @return {void}\n * @override\n */\n _logger(level, args) {\n // accept ['foo', 'bar'] and [['foo', 'bar']]\n if (Array.isArray(args) && args.length === 1 && Array.isArray(args[0])) {\n args = args[0];\n }\n switch(level) {\n case 'log':\n case 'warn':\n case 'error':\n console[level](...args);\n }\n }\n\n /**\n * Facades `console.log` as an override point.\n *\n * @param {...*} args Array of strings or objects to log\n * @return {void}\n * @override\n */\n _log(...args) {\n this._logger('log', args);\n }\n\n /**\n * Facades `console.warn` as an override point.\n *\n * @param {...*} args Array of strings or objects to log\n * @return {void}\n * @override\n */\n _warn(...args) {\n this._logger('warn', args);\n }\n\n /**\n * Facades `console.error` as an override point.\n *\n * @param {...*} args Array of strings or objects to log\n * @return {void}\n * @override\n */\n _error(...args) {\n this._logger('error', args);\n }\n\n /**\n * Formats a message using the element type an a method name.\n *\n * @param {string} methodName Method name to associate with message\n * @param {...*} args Array of strings or objects to log\n * @return {!Array} Array with formatting information for `console`\n * logging.\n * @override\n */\n _logf(methodName, ...args) {\n return ['[%s::%s]', this.is, methodName, ...args];\n }\n\n }\n\n LegacyElement.prototype.is = '';\n\n return LegacyElement;\n});\n", "/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport { LegacyElementMixin } from './legacy-element-mixin.js';\nimport { legacyOptimizations } from '../utils/settings.js';\n\nconst lifecycleProps = {\n attached: true,\n detached: true,\n ready: true,\n created: true,\n beforeRegister: true,\n registered: true,\n attributeChanged: true,\n listeners: true,\n hostAttributes: true\n};\n\nconst excludeOnInfo = {\n attached: true,\n detached: true,\n ready: true,\n created: true,\n beforeRegister: true,\n registered: true,\n attributeChanged: true,\n behaviors: true,\n _noAccessors: true\n};\n\nconst excludeOnBehaviors = Object.assign({\n listeners: true,\n hostAttributes: true,\n properties: true,\n observers: true,\n}, excludeOnInfo);\n\nfunction copyProperties(source, target, excludeProps) {\n const noAccessors = source._noAccessors;\n const propertyNames = Object.getOwnPropertyNames(source);\n for (let i = 0; i < propertyNames.length; i++) {\n let p = propertyNames[i];\n if (p in excludeProps) {\n continue;\n }\n if (noAccessors) {\n target[p] = source[p];\n } else {\n let pd = Object.getOwnPropertyDescriptor(source, p);\n if (pd) {\n // ensure property is configurable so that a later behavior can\n // re-configure it.\n pd.configurable = true;\n Object.defineProperty(target, p, pd);\n }\n }\n }\n}\n\n/**\n * Applies a \"legacy\" behavior or array of behaviors to the provided class.\n *\n * Note: this method will automatically also apply the `LegacyElementMixin`\n * to ensure that any legacy behaviors can rely on legacy Polymer API on\n * the underlying element.\n *\n * @function\n * @template T\n * @param {!Object|!Array<!Object>} behaviors Behavior object or array of behaviors.\n * @param {function(new:T)} klass Element class.\n * @return {?} Returns a new Element class extended by the\n * passed in `behaviors` and also by `LegacyElementMixin`.\n * @suppress {invalidCasts, checkTypes}\n */\nexport function mixinBehaviors(behaviors, klass) {\n return GenerateClassFromInfo({}, LegacyElementMixin(klass), behaviors);\n}\n\n// NOTE:\n// 1.x\n// Behaviors were mixed in *in reverse order* and de-duped on the fly.\n// The rule was that behavior properties were copied onto the element\n// prototype if and only if the property did not already exist.\n// Given: Polymer{ behaviors: [A, B, C, A, B]}, property copy order was:\n// (1), B, (2), A, (3) C. This means prototype properties win over\n// B properties win over A win over C. This mirrors what would happen\n// with inheritance if element extended B extended A extended C.\n//\n// Again given, Polymer{ behaviors: [A, B, C, A, B]}, the resulting\n// `behaviors` array was [C, A, B].\n// Behavior lifecycle methods were called in behavior array order\n// followed by the element, e.g. (1) C.created, (2) A.created,\n// (3) B.created, (4) element.created. There was no support for\n// super, and \"super-behavior\" methods were callable only by name).\n//\n// 2.x\n// Behaviors are made into proper mixins which live in the\n// element's prototype chain. Behaviors are placed in the element prototype\n// eldest to youngest and de-duped youngest to oldest:\n// So, first [A, B, C, A, B] becomes [C, A, B] then,\n// the element prototype becomes (oldest) (1) PolymerElement, (2) class(C),\n// (3) class(A), (4) class(B), (5) class(Polymer({...})).\n// Result:\n// This means element properties win over B properties win over A win\n// over C. (same as 1.x)\n// If lifecycle is called (super then me), order is\n// (1) C.created, (2) A.created, (3) B.created, (4) element.created\n// (again same as 1.x)\nfunction applyBehaviors(proto, behaviors, lifecycle) {\n for (let i=0; i<behaviors.length; i++) {\n applyInfo(proto, behaviors[i], lifecycle, excludeOnBehaviors);\n }\n}\n\nfunction applyInfo(proto, info, lifecycle, excludeProps) {\n copyProperties(info, proto, excludeProps);\n for (let p in lifecycleProps) {\n if (info[p]) {\n lifecycle[p] = lifecycle[p] || [];\n lifecycle[p].push(info[p]);\n }\n }\n}\n\n/**\n * @param {Array} behaviors List of behaviors to flatten.\n * @param {Array=} list Target list to flatten behaviors into.\n * @param {Array=} exclude List of behaviors to exclude from the list.\n * @return {!Array} Returns the list of flattened behaviors.\n */\nfunction flattenBehaviors(behaviors, list, exclude) {\n list = list || [];\n for (let i=behaviors.length-1; i >= 0; i--) {\n let b = behaviors[i];\n if (b) {\n if (Array.isArray(b)) {\n flattenBehaviors(b, list);\n } else {\n // dedup\n if (list.indexOf(b) < 0 && (!exclude || exclude.indexOf(b) < 0)) {\n list.unshift(b);\n }\n }\n } else {\n console.warn('behavior is null, check for missing or 404 import');\n }\n }\n return list;\n}\n\n/**\n * Copies property descriptors from source to target, overwriting all fields\n * of any previous descriptor for a property *except* for `value`, which is\n * merged in from the target if it does not exist on the source.\n *\n * @param {*} target Target properties object\n * @param {*} source Source properties object\n */\nfunction mergeProperties(target, source) {\n for (const p in source) {\n const targetInfo = target[p];\n const sourceInfo = source[p];\n if (!('value' in sourceInfo) && targetInfo && ('value' in targetInfo)) {\n target[p] = Object.assign({value: targetInfo.value}, sourceInfo);\n } else {\n target[p] = sourceInfo;\n }\n }\n}\n\nconst LegacyElement = LegacyElementMixin(HTMLElement);\n\n/* Note about construction and extension of legacy classes.\n [Changed in Q4 2018 to optimize performance.]\n\n When calling `Polymer` or `mixinBehaviors`, the generated class below is\n made. The list of behaviors was previously made into one generated class per\n behavior, but this is no longer the case as behaviors are now called\n manually. Note, there may *still* be multiple generated classes in the\n element's prototype chain if extension is used with `mixinBehaviors`.\n\n The generated class is directly tied to the info object and behaviors\n used to create it. That list of behaviors is filtered so it's only the\n behaviors not active on the superclass. In order to call through to the\n entire list of lifecycle methods, it's important to call `super`.\n\n The element's `properties` and `observers` are controlled via the finalization\n mechanism provided by `PropertiesMixin`. `Properties` and `observers` are\n collected by manually traversing the prototype chain and merging.\n\n To limit changes, the `_registered` method is called via `_initializeProperties`\n and not `_finalizeClass`.\n\n*/\n/**\n * @param {!PolymerInit} info Polymer info object\n * @param {function(new:HTMLElement)} Base base class to extend with info object\n * @param {Object=} behaviors behaviors to copy into the element\n * @return {function(new:HTMLElement)} Generated class\n * @suppress {checkTypes}\n * @private\n */\nfunction GenerateClassFromInfo(info, Base, behaviors) {\n\n // manages behavior and lifecycle processing (filled in after class definition)\n let behaviorList;\n const lifecycle = {};\n\n /** @private */\n class PolymerGenerated extends Base {\n\n // explicitly not calling super._finalizeClass\n /** @nocollapse */\n static _finalizeClass() {\n // if calling via a subclass that hasn't been generated, pass through to super\n if (!this.hasOwnProperty(JSCompiler_renameProperty('generatedFrom', this))) {\n // TODO(https://github.com/google/closure-compiler/issues/3240):\n // Change back to just super.methodCall()\n Base._finalizeClass.call(this);\n } else {\n // interleave properties and observers per behavior and `info`\n if (behaviorList) {\n for (let i=0, b; i < behaviorList.length; i++) {\n b = behaviorList[i];\n if (b.properties) {\n this.createProperties(b.properties);\n }\n if (b.observers) {\n this.createObservers(b.observers, b.properties);\n }\n }\n }\n if (info.properties) {\n this.createProperties(info.properties);\n }\n if (info.observers) {\n this.createObservers(info.observers, info.properties);\n }\n // make sure to prepare the element template\n this._prepareTemplate();\n }\n }\n\n /** @nocollapse */\n static get properties() {\n const properties = {};\n if (behaviorList) {\n for (let i=0; i < behaviorList.length; i++) {\n mergeProperties(properties, behaviorList[i].properties);\n }\n }\n mergeProperties(properties, info.properties);\n return properties;\n }\n\n /** @nocollapse */\n static get observers() {\n let observers = [];\n if (behaviorList) {\n for (let i=0, b; i < behaviorList.length; i++) {\n b = behaviorList[i];\n if (b.observers) {\n observers = observers.concat(b.observers);\n }\n }\n }\n if (info.observers) {\n observers = observers.concat(info.observers);\n }\n return observers;\n }\n\n /**\n * @return {void}\n */\n created() {\n super.created();\n const list = lifecycle.created;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this);\n }\n }\n }\n\n /**\n * @return {void}\n */\n _registered() {\n /* NOTE: `beforeRegister` is called here for bc, but the behavior\n is different than in 1.x. In 1.0, the method was called *after*\n mixing prototypes together but *before* processing of meta-objects.\n However, dynamic effects can still be set here and can be done either\n in `beforeRegister` or `registered`. It is no longer possible to set\n `is` in `beforeRegister` as you could in 1.x.\n */\n // only proceed if the generated class' prototype has not been registered.\n const generatedProto = PolymerGenerated.prototype;\n if (!generatedProto.hasOwnProperty(JSCompiler_renameProperty('__hasRegisterFinished', generatedProto))) {\n generatedProto.__hasRegisterFinished = true;\n // ensure superclass is registered first.\n super._registered();\n // copy properties onto the generated class lazily if we're optimizing,\n if (legacyOptimizations) {\n copyPropertiesToProto(generatedProto);\n }\n // make sure legacy lifecycle is called on the *element*'s prototype\n // and not the generated class prototype; if the element has been\n // extended, these are *not* the same.\n const proto = Object.getPrototypeOf(this);\n let list = lifecycle.beforeRegister;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(proto);\n }\n }\n list = lifecycle.registered;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(proto);\n }\n }\n }\n }\n\n /**\n * @return {void}\n */\n _applyListeners() {\n super._applyListeners();\n const list = lifecycle.listeners;\n if (list) {\n for (let i=0; i < list.length; i++) {\n const listeners = list[i];\n if (listeners) {\n for (let l in listeners) {\n this._addMethodEventListenerToNode(this, l, listeners[l]);\n }\n }\n }\n }\n }\n\n // note: exception to \"super then me\" rule;\n // do work before calling super so that super attributes\n // only apply if not already set.\n /**\n * @return {void}\n */\n _ensureAttributes() {\n const list = lifecycle.hostAttributes;\n if (list) {\n for (let i=list.length-1; i >= 0; i--) {\n const hostAttributes = list[i];\n for (let a in hostAttributes) {\n this._ensureAttribute(a, hostAttributes[a]);\n }\n }\n }\n super._ensureAttributes();\n }\n\n /**\n * @return {void}\n */\n ready() {\n super.ready();\n let list = lifecycle.ready;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this);\n }\n }\n }\n\n /**\n * @return {void}\n */\n attached() {\n super.attached();\n let list = lifecycle.attached;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this);\n }\n }\n }\n\n /**\n * @return {void}\n */\n detached() {\n super.detached();\n let list = lifecycle.detached;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this);\n }\n }\n }\n\n /**\n * Implements native Custom Elements `attributeChangedCallback` to\n * set an attribute value to a property via `_attributeToProperty`.\n *\n * @param {string} name Name of attribute that changed\n * @param {?string} old Old attribute value\n * @param {?string} value New attribute value\n * @return {void}\n */\n attributeChanged(name, old, value) {\n super.attributeChanged();\n let list = lifecycle.attributeChanged;\n if (list) {\n for (let i=0; i < list.length; i++) {\n list[i].call(this, name, old, value);\n }\n }\n }\n }\n\n // apply behaviors, note actual copying is done lazily at first instance creation\n if (behaviors) {\n // NOTE: ensure the behavior is extending a class with\n // legacy element api. This is necessary since behaviors expect to be able\n // to access 1.x legacy api.\n if (!Array.isArray(behaviors)) {\n behaviors = [behaviors];\n }\n let superBehaviors = Base.prototype.behaviors;\n // get flattened, deduped list of behaviors *not* already on super class\n behaviorList = flattenBehaviors(behaviors, null, superBehaviors);\n PolymerGenerated.prototype.behaviors = superBehaviors ?\n superBehaviors.concat(behaviors) : behaviorList;\n }\n\n const copyPropertiesToProto = (proto) => {\n if (behaviorList) {\n applyBehaviors(proto, behaviorList, lifecycle);\n }\n applyInfo(proto, info, lifecycle, excludeOnInfo);\n };\n\n // copy properties if we're not optimizing\n if (!legacyOptimizations) {\n copyPropertiesToProto(PolymerGenerated.prototype);\n }\n\n PolymerGenerated.generatedFrom = info;\n\n return PolymerGenerated;\n}\n\n/**\n * Generates a class that extends `LegacyElement` based on the\n * provided info object. Metadata objects on the `info` object\n * (`properties`, `observers`, `listeners`, `behaviors`, `is`) are used\n * for Polymer's meta-programming systems, and any functions are copied\n * to the generated class.\n *\n * Valid \"metadata\" values are as follows:\n *\n * `is`: String providing the tag name to register the element under. In\n * addition, if a `dom-module` with the same id exists, the first template\n * in that `dom-module` will be stamped into the shadow root of this element,\n * with support for declarative event listeners (`on-...`), Polymer data\n * bindings (`[[...]]` and `{{...}}`), and id-based node finding into\n * `this.$`.\n *\n * `properties`: Object describing property-related metadata used by Polymer\n * features (key: property names, value: object containing property metadata).\n * Valid keys in per-property metadata include:\n * - `type` (String|Number|Object|Array|...): Used by\n * `attributeChangedCallback` to determine how string-based attributes\n * are deserialized to JavaScript property values.\n * - `notify` (boolean): Causes a change in the property to fire a\n * non-bubbling event called `<property>-changed`. Elements that have\n * enabled two-way binding to the property use this event to observe changes.\n * - `readOnly` (boolean): Creates a getter for the property, but no setter.\n * To set a read-only property, use the private setter method\n * `_setProperty(property, value)`.\n * - `observer` (string): Observer method name that will be called when\n * the property changes. The arguments of the method are\n * `(value, previousValue)`.\n * - `computed` (string): String describing method and dependent properties\n * for computing the value of this property (e.g. `'computeFoo(bar, zot)'`).\n * Computed properties are read-only by default and can only be changed\n * via the return value of the computing method.\n *\n * `observers`: Array of strings describing multi-property observer methods\n * and their dependent properties (e.g. `'observeABC(a, b, c)'`).\n *\n * `listeners`: Object describing event listeners to be added to each\n * instance of this element (key: event name, value: method name).\n *\n * `behaviors`: Array of additional `info` objects containing metadata\n * and callbacks in the same format as the `info` object here which are\n * merged into this element.\n *\n * `hostAttributes`: Object listing attributes to be applied to the host\n * once created (key: attribute name, value: attribute value). Values\n * are serialized based on the type of the value. Host attributes should\n * generally be limited to attributes such as `tabIndex` and `aria-...`.\n * Attributes in `hostAttributes` are only applied if a user-supplied\n * attribute is not already present (attributes in markup override\n * `hostAttributes`).\n *\n * In addition, the following Polymer-specific callbacks may be provided:\n * - `registered`: called after first instance of this element,\n * - `created`: called during `constructor`\n * - `attached`: called during `connectedCallback`\n * - `detached`: called during `disconnectedCallback`\n * - `ready`: called before first `attached`, after all properties of\n * this element have been propagated to its template and all observers\n * have run\n *\n * @param {!PolymerInit} info Object containing Polymer metadata and functions\n * to become class methods.\n * @template T\n * @param {function(T):T} mixin Optional mixin to apply to legacy base class\n * before extending with Polymer metaprogramming.\n * @return {function(new:HTMLElement)} Generated class\n */\nexport const Class = function(info, mixin) {\n if (!info) {\n console.warn('Polymer.Class requires `info` argument');\n }\n let klass = mixin ? mixin(LegacyElement) :\n LegacyElement;\n klass = GenerateClassFromInfo(info, klass, info.behaviors);\n // decorate klass with registration info\n klass.is = klass.prototype.is = info.is;\n return klass;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAYO,IAAM,eAAe,EAAE,OAAO,UAAU,KAAK,OAAO,UAAU,EAAE,OAAO;AAC9E,IAAI;AAKJ,SAAS,iBAAiB,UAAU;AAClC,MAAI,YAAY,SAAS,mBAAmB,GAAG;AAC7C,0BAAsB;AAAA,EACxB,OAAO;AAOL,0BAAsB,gBAAgB,QAAQ,CAAC,UAAU,UAAU,MAAM,2BAA2B,KAClG,OAAO,OAAO,IAAI,YAAY,IAAI,SAAS,cAAc,kBAAkB,CAAC;AAAA,EAChF;AACF;AAGO,IAAI;AACX,IAAI,OAAO,YAAY,OAAO,SAAS,aAAa,QAAW;AAC7D,aAAW,OAAO,SAAS;AAC7B;AAGO,IAAM,iBAAiB,QAAQ,OAAO,YAAY,OAAO,SAAS,cAAc;AAEvF,IAAI,OAAO,YAAY,OAAO,SAAS,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SAAS;AAAA,EAClD;AAEA,mBAAiB,gBAAgB;AAEjC,SAAO;AACT;AAwEO,IAAM,QAAQ,SAAS,MAAM,OAAO;AACzC,MAAI,CAAC,MAAM;AACT,YAAQ,KAAK,wCAAwC;AAAA,EACvD;AACA,MAAI,QAAQ,QAAQ,MAAM,aAAa,IACnC;AACJ,UAAQ,sBAAsB,MAAM,OAAO,KAAK,SAAS;AAEzD,QAAM,KAAK,MAAM,UAAU,KAAK,KAAK;AACrC,SAAO;AACT;",
6
+ "names": ["p", "wrap", "p", "p", "prefix", "resolve", "CustomStyleInterface", "register", "register", "movefn", "e", "upfn", "GestureEventListeners", "node", "ShadyDOM", "DISABLED_ATTR", "LegacyElement", "dom", "p"]
7
+ }