summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/catapult/third_party/polymer2/bower_components/webcomponentsjs/webcomponents-sd-ce.js.map
blob: f65350827a5d59ee0d7700ddb35fa36969fc06bb (plain)
1
{"version":3,"sources":["node_modules/@webcomponents/shadydom/src/shady-data.js"," [synthetic:util/global] "," [synthetic:util/defineproperty] "," [synthetic:es6/symbol] "," [synthetic:es6/util/makeiterator] "," [synthetic:es6/util/arrayfromiterator] ","node_modules/@webcomponents/shadydom/src/utils.js","node_modules/@webcomponents/shadydom/src/flush.js","node_modules/@webcomponents/shadydom/src/observe-changes.js","node_modules/@webcomponents/shadydom/src/native-methods.js","node_modules/@webcomponents/shadydom/src/innerHTML.js","node_modules/@webcomponents/shadydom/src/native-tree-walker.js","node_modules/@webcomponents/shadydom/src/native-tree-accessors.js","node_modules/@webcomponents/shadydom/src/native-tree.js","node_modules/@webcomponents/shadydom/src/patch-accessors.js","node_modules/@webcomponents/shadydom/src/attach-shadow.js","node_modules/@webcomponents/shadydom/src/patch-builtins.js","node_modules/@webcomponents/shadydom/src/logical-tree.js","node_modules/@webcomponents/shadydom/src/logical-mutation.js"," [synthetic:es6/util/arrayfromiterable] ","node_modules/@webcomponents/shadydom/src/patch-events.js","node_modules/@webcomponents/shadydom/src/array-splice.js","node_modules/@webcomponents/shadydom/src/shadydom.js","node_modules/@webcomponents/custom-elements/src/Utilities.js","node_modules/@webcomponents/custom-elements/src/CustomElementInternals.js","node_modules/@webcomponents/custom-elements/src/CustomElementState.js","node_modules/@webcomponents/custom-elements/src/DocumentConstructionObserver.js","node_modules/@webcomponents/custom-elements/src/CustomElementRegistry.js","node_modules/@webcomponents/custom-elements/src/Deferred.js","node_modules/@webcomponents/custom-elements/src/Patch/Native.js","node_modules/@webcomponents/custom-elements/src/AlreadyConstructedMarker.js","node_modules/@webcomponents/custom-elements/src/Patch/HTMLElement.js","node_modules/@webcomponents/custom-elements/src/custom-elements.js","node_modules/@webcomponents/custom-elements/src/Patch/Interface/ParentNode.js","node_modules/@webcomponents/custom-elements/src/Patch/Document.js","node_modules/@webcomponents/custom-elements/src/Patch/Node.js","node_modules/@webcomponents/custom-elements/src/Patch/Interface/ChildNode.js","node_modules/@webcomponents/custom-elements/src/Patch/Element.js","node_modules/@webcomponents/custom-elements/src/Patch/DocumentFragment.js","node_modules/@webcomponents/shadycss/src/css-parse.js","node_modules/@webcomponents/shadycss/src/style-settings.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/style-transformer.js","node_modules/@webcomponents/shadycss/src/style-info.js","node_modules/@webcomponents/shadycss/src/style-properties.js","node_modules/@webcomponents/shadycss/src/style-placeholder.js","node_modules/@webcomponents/shadycss/src/style-cache.js","node_modules/@webcomponents/shadycss/src/document-watcher.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/scoping-shim.js","node_modules/@webcomponents/shadycss/src/common-utils.js","node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js","entrypoints/webcomponents-sd-ce-index.js"],"names":["$jscomp.global","$jscomp.defineProperty","$jscomp.initSymbol","$jscomp.Symbol","$jscomp.SYMBOL_PREFIX","$jscomp.arrayIterator","$jscomp.initSymbolIterator","$jscomp.iteratorPrototype","constructor","ShadyData","publicRoot","root","dirty","flattenedNodes","_prevAssignedSlot","_previouslyAssignedNodes","assignedSlot","assignedNodes","observer","childNodes","nextSibling","previousSibling","lastChild","firstChild","parentNode","ownerShadyRoot","undefined","__insideAccessors","__outsideAccessors","toJSON","ensureShadyDataForNode","node","__shady","shadyDataForNode","settings","window","hasNativeShadowDOM","attachShadow","Element","prototype","getRootNode","Node","desc","Object","getOwnPropertyDescriptor","hasDescriptors","configurable","get","inUse","IS_IE","navigator","userAgent","match","IS_EDGE","useNativeAccessors","isTrackingLogicalChildNodes","nodeData","isShadyRoot","obj","_localName","ownerShadyRootForNode","p","matches","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","extend","target","source","n$","getOwnPropertyNames","i","n","length","pd","defineProperty","extendAll","sources","mixin","twiddle","document","createTextNode","content","queue","observe","MutationObserver","shift","e","textContent","characterData","microtask","callback","push","hasDocumentContains","contains","container","flushList","scheduled","enqueue","flush","didFlush","AsyncObserver","_scheduled","addedNodes","removedNodes","callbacks","Set","schedule","mutations","takeRecords","forEach","cb","observeChildren","sd","add","_callback","_observer","_node","unobserveChildren","handle","delete","size","filterMutations","targetRootNode","map","mutation","mutationInScope","nodes","Array","from","filter","create","value","m","insertBefore","replaceChild","removeChild","setAttribute","removeAttribute","cloneNode","importNode","Document","addEventListener","removeEventListener","windowAddEventListener","Window","windowRemoveEventListener","dispatchEvent","HTMLElement","getElementById","elementQuerySelector","querySelector","fragmentQuerySelector","DocumentFragment","documentQuerySelector","elementQuerySelectorAll","querySelectorAll","fragmentQuerySelectorAll","documentQuerySelectorAll","appendChild","selector","nodeType","ELEMENT_NODE","call","DOCUMENT_NODE","escapeAttrRegExp","escapeDataRegExp","escapeReplace","c","makeSet","arr","set","voidElements","plaintextParents","getInnerHTML","localName","s","c$","l","child","tagName","attrs","attributes","attr","name","replace","TEXT_NODE","data","COMMENT_NODE","console","error","Error","nodeWalker","createTreeWalker","NodeFilter","SHOW_ALL","elementWalker","SHOW_ELEMENT","currentNode","parentElement","firstElementChild","lastElementChild","previousElementSibling","nextElementSibling","children","innerHTML","DOCUMENT_FRAGMENT_NODE","textWalker","SHOW_TEXT","nextNode","nodeValue","nativeProtos","findNodeDescriptor","proto","hasOwnProperty","nodeAccessors","fragmentAccessors","documentAccessors","slice","accessors","nativeTreeAccessors","nativeTreeWalker","clearNode","inertDoc","implementation","createHTMLDocument","nativeIsConnectedAccessors","nativeIsConnected","nativeActiveElementDescriptor","OutsideAccessors","ClassNameAccessor","className","getAttribute","InsideAccessors","item","childNodes.item","index","childElementCount","tc","cn","join","text","nativeAccessors","children.item","containerName","htmlContainer","createElement","ShadowRootAccessor","shadowRoot","ActiveElementAccessor","activeElement","active","host","nativeContains","activeRoot","patchAccessorGroup","descriptors","force","objDesc","warn","patchAccessors","patchShadowRootAccessors","ShadyRoot","__proto__","defineProperties","nodeName","prop","patchOutsideElementAccessors","element","patchInsideElementAccessors","linkNode","ref_node","containerData","ref_nodeData","psd","nsd","recordChildNodes","parent","refData","ownerRoot","slotsAdded","slots","_ensureSlotData","_pendingSlots","_slotList","_slotMap","$jscomp.arrayFromIterator","$jscomp.makeIterator","_asyncRender","resetTo","parentData","hasShadowRootWithSlot","preventNativeInsert","firstComposedNode","nativeMethods","scheduleObserver","preventNativeRemove","removeOwnerShadyRoot","changeSlotContent","_validateSlots","slot","splice","x","indexOf","didRemove","removingInsertionPoint","composed","flattened","_hasInsertionPoint","distributeAttributeChange","oldName","__slotName","_nameForSlot","list","_sortSlots","addedNode","removedNode","documentElement","query","matcher","halter","queryElements","elements","result","scopingShim","deep","ownerDocument","nc","eventWrappersName","Date","now","alwaysComposed","pathComposer","startNode","composedPath","current","startRoot","retarget","refNode","path","refNodePath","ancestor","lastRoot","rootIdx","eventMixin","isTrusted","__composed","type","__composedPath","currentTarget","relatedTarget","__relatedTarget","__relatedTargetComposedPath","stopPropagation","Event","__propagationStopped","stopImmediatePropagation","__immediatePropagationStopped","mixinComposedFlag","Base","klazz","options","event","nonBubblingEventsToRetarget","hasRetargeted","fireHandlers","phase","hs","__handlers","fn","retargetNonBubblingEvent","AT_TARGET","lastFiredRoot","findListener","wrappers","capture","once","passive","savedType","savedListener","savedCapture","savedOnce","savedPassive","savedNode","fnOrObj","optionsOrCapture","handlerType","handleEvent","__shadyTarget","wrapperFn","patchEvent","lastCurrentTargetDesc","eventPhase","BUBBLING_PHASE","CAPTURING_PHASE","bubbles","ret","ael","idx","rel","activateFocusEventOverrides","ev","getPrototypeOf","patchProto","__sourceProto","PatchedEvent","PatchedCustomEvent","CustomEvent","PatchedMouseEvent","MouseEvent","newSplice","addedCount","removed","calcSplices","currentEnd","old","oldEnd","currentStart","oldStart","prefixCount","suffixCount","minLength","Math","min","currentValue","previousValue","index1","index2","count","equals","rowCount","columnCount","distances","j","north","west","edits","EDIT_ADD","EDIT_DELETE","northWest","EDIT_LEAVE","EDIT_UPDATE","reverse","splices","oldIndex","ShadyRootConstructionToken","ancestorList","ancestors","unshift","token","TypeError","SHADYROOT_NAME","_mode","mode","hostData","MODE_CLOSED","rootData","_renderPending","_render","renderRoot","_distribute","slotData","_distributeNodeToSlot","slotParentRoot","slotParentData","_addAssignedToFlattenedNodes","prevAssignedNodes","_fireSlotChange","_compose","composeList","targetNode","distributedNode","d","next","forcedSlot","oldSlot","CATCHALL_NAME","assigned","nestedAssigned","slotNamesToSort","_mapSlots","sort","a","b","listA","listB","nA","nB","getAssignedSlot","windowMixin","bind","nodeMixin","IsConnectedAccessor","isConnected","textMixin","fragmentMixin","useNative","o","slotMixin","flatten","elementMixin","documentMixin","id","nativeBlur","blur","htmlElementMixin","shadowActive","shadowRootMixin","patchBuiltin","ShadyDOM","patch","nativeHTMLElement","Text","HTMLSlotElement","ShadowRoot","reservedTagList","isValidCustomElementName","reserved","has","validForm","test","nativeValue","__CE_isImportDocument","nextSiblingOrAncestorSibling","start","walkDeepDescendantElements","visitedImports","import","__CE_shadowRoot","setPropertyUnchecked","destination","CustomElementInternals","_localNameToDefinition","Map","_constructorToDefinition","_patches","_hasPatches","setDefinition","definition","addPatch","listener","patchTree","__CE_patched","connectTree","custom","__CE_state","connectedCallback","upgradeElement","disconnectTree","disconnectedCallback","patchAndUpgradeTree","upgrade","gatherElements","__CE_hasRegistry","readyState","__CE_documentLoadHandled","clonedVisitedImports","defaultView","localNameToDefinition","constructionStack","pop","failed","__CE_definition","attributeChangedCallback","observedAttributes","oldValue","newValue","namespace","DocumentConstructionObserver","internals","doc","_internals","_document","_handleMutations","childList","subtree","disconnect","Deferred","_resolve","_value","_promise","Promise","resolve","CustomElementRegistry","_elementDefinitionIsRunning","_whenDefinedDeferred","_flushCallback","this._flushCallback","_flushPending","_pendingDefinitions","_documentConstructionObserver","CustomElementRegistry$$module$node_modules$$webcomponents$custom_elements$src$CustomElementRegistry.prototype","?.prototype","define","Function","SyntaxError","getCallback","callbackValue","adoptedCallback","_flush","pendingDefinitions","elementsWithStableDefinitions","elementsWithPendingDefinitions","pendingElements","pendingUpgradableElements","deferred","CustomElementRegistry$$module$node_modules$$webcomponents$custom_elements$src$CustomElementRegistry_prototype$whenDefined","whenDefined","reject","prior","some","polyfillWrapFlushCallback","outer","inner","Document_createElement","Document_createElementNS","createElementNS","Document_importNode","Document_prepend","Document_append","DocumentFragment_prepend","DocumentFragment_append","Node_cloneNode","Node_appendChild","Node_insertBefore","Node_removeChild","Node_replaceChild","Node_textContent","Element_attachShadow","Element_innerHTML","Element_getAttribute","Element_setAttribute","Element_removeAttribute","Element_getAttributeNS","getAttributeNS","Element_setAttributeNS","setAttributeNS","Element_removeAttributeNS","removeAttributeNS","Element_insertAdjacentElement","Element_insertAdjacentHTML","Element_prepend","Element_append","Element_before","Element_after","Element_replaceWith","Element_remove","HTMLElement_innerHTML","HTMLElement_insertAdjacentElement","HTMLElement_insertAdjacentHTML","$jscompDefaultExport","AlreadyConstructedMarker","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_createElement.call","setPrototypeOf","lastIndex","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement","builtIn","appendPrependPatch","builtInMethod","connectedElements","apply","prepend","append","clone","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_importNode.call","NS_HTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_createElementNS.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_prepend","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Document_append","patch_textContent","baseDescriptor","enumerable","assignedValue","childNodesLength","insertedNodes","nativeResult","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_insertBefore.call","nodeWasConnected","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_appendChild.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_cloneNode.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_removeChild.call","nodeToInsert","nodeToRemove","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_replaceChild.call","nodeToInsertWasConnected","thisIsConnected","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_textContent","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Node_textContent.get","parts","beforeAfterPatch","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_before","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_after","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_replaceWith","wasConnected","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_remove","patch_innerHTML","htmlString","removedElements","patch_insertAdjacentElement","baseMethod","position","insertedElement","patch_insertAdjacentHTML","upgradeNodesInRange","end","toLowerCase","marker","String","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_attachShadow","init","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_attachShadow.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_innerHTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_innerHTML.get","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement_innerHTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement_innerHTML.get","isTemplate","rawElement","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_setAttribute.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_getAttribute.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_setAttributeNS.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_getAttributeNS.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_removeAttribute.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_removeAttributeNS.call","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement_insertAdjacentElement","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_insertAdjacentElement","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.HTMLElement_insertAdjacentHTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_insertAdjacentHTML","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_prepend","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.Element_append","priorCustomElements","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.DocumentFragment_prepend","$jscompDefaultExport$$module$node_modules$$webcomponents$custom_elements$src$Patch$Native.DocumentFragment_append","customElements","StyleNode","parse","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.comments","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.port","parseCss","OPEN_BRACE","previous","CLOSE_BRACE","t","substring","trim","ss","_expandUnicodeEscapes","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.multipleSpaces","lastIndexOf","AT_START","MEDIA_START","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.MEDIA_RULE","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.keyframesRule","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.KEYFRAMES_RULE","split","VAR_START","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.MIXIN_RULE","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.STYLE_RULE","r$","r","code","repeat","stringify","preserveProperties","cssText","rules","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.customProp","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.mixinProp","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.mixinApply","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.varApply","STYLE_RULE","KEYFRAMES_RULE","MEDIA_RULE","MIXIN_RULE","comments","port","customProp","mixinProp","mixinApply","varApply","keyframesRule","multipleSpaces","nativeShadow","nativeCssVariables_","calcCssVariables","CSS","supports","ShadyCSS","nativeCss","nativeCssVariables","VAR_ASSIGN","MIXIN_MATCH","VAR_CONSUMED","ANIMATION_MATCH","MEDIA_MATCH","BRACKETED","styleTextSet","toCssText","forEachRule","rulesForStyle","style","isKeyframesSelector","rule","styleRuleCallback","keyframesRuleCallback","onlyActiveRules","skipRules","matchMedia","applyCss","moniker","contextNode","applyStyle","lastHeadApplyNode","head","compareDocumentPosition","DOCUMENT_POSITION_PRECEDING","processVariableAndFallback","str","level","prefix","suffix","comma","fallback","setElementClassRaw","getIsExtends","typeExtension","is","extends","StyleTransformer","dom","scope","shouldRemoveScope","_transformDom","_content","classList","remove","SCOPE_NAME","CLASS","elementStyles","styleRules","cssBuildType","css","ext","hostScope","_calcHostScope","CSS_CLASS_PREFIX","isScoped","transformedSelector","_transformRuleCss","self","_transformComplexSelector","transformer","p$","COMPLEX_SELECTOR_SEP","_twiddleNthPlus","NTH","inside","stop","isNth","SLOTTED_START","HOST","SIMPLE_SELECTOR_SEP","info","_transformCompoundSelector","combinator","slottedIndex","SLOTTED","_transformHostSelector","_transformSimpleSelector","slotted","SLOTTED_PAREN","paren","DIR_PAREN","before","dir","PSEUDO_PREFIX","HOST_PAREN","SIMPLE_SELECTOR_PREFIX","typeSelector","SELECTOR_NO_MATCH","normalizeRootSelector","ROOT","_transformDocumentSelector","SCOPE_DOC_SELECTOR","$jscomp.global.Object.defineProperties","RegExp","StyleInfo","ast","placeholder","ownStylePropertyNames","overrideStyleProperties","customStyle","scopeSelector","styleProperties","styleInfo","_getStyleRules","method","StyleProperties","decorateStyles","props","keyframes","ruleIndex","decorateRule","propertyInfo","exec","onKeyframesRule","_keyframes","names","properties","collectProperties","hasProperties","assign","any","valueForProperty","property","valueForProperties","propertyValue","colon","pp","propertyDataFromStyles","selectorToMatch","parseInt","key","whenHostOrRootRule","cssBuild","parsedSelector","isRoot","isHost","hostAndRootPropertiesForScope","hostProps","rootProps","_element","transformStyles","hostSelector","hostRx","HOST_PREFIX","rxHostSelector","HOST_SUFFIX","StyleInfo$$module$node_modules$$webcomponents$shadycss$src$style_info.get","keyframeTransforms","_elementKeyframeTransforms","output","input","hasAnimations","keyframeNamesToTransform","keyframe","transform","keyframesRules","keyframesNameRx","transformedKeyframesName","scopeId","_keyframesRuleTransformer","applyCustomStyle","XSCOPE_NAME","placeholderMap","ce","origDefine","wrappedDefine","clazz","placeHolder","createComment","after","StyleCache","cache","store","tagname","styleElement","typeMax","fetch","ownPropertyNames","entry","pn","handler","mxns","mxn","classes","hasAttribute","currentScope","newScope","unscoped","delayedStart","body","requestAnimationFrame","module$node_modules$$webcomponents$shadycss$src$document_watcher.flush","templateMap","promise","invalidate","elementName","template","templateIsValid","startValidatingTemplate","_validating","then","readyPromise","whenReady","resolveFn","documentWait","styleCache","ScopingShim","_scopeCounter","_documentOwner","_documentOwnerStyleInfo","StyleInfo$$module$node_modules$$webcomponents$shadycss$src$style_info.set","_elementsHaveApplied","_customStyleInterface","_applyShim","_ensure","ScopingShim$$module$node_modules$$webcomponents$shadycss$src$scoping_shim.prototype","ScopingShim$$module$node_modules$$webcomponents$shadycss$src$scoping_shim_prototype$flush","getStyleAst","styleAstToString","prepareTemplate","_prepared","styleTextParts","styles","scopingAttribute","newStyle","__cssBuild","_cssBuild","shadowroot","_style","_ownPropertyNames","_ensureCustomStyleInterface","CustomStyleInterface","transformCustomStyleForDocument","flushCustomStyles","_ensureApplyShim","ApplyShim","customStyles","_revalidateCustomStyleApplyShim","_updateProperties","_applyCustomStyles","styleDocument","overrideProps","_isRootOwner","removeProperty","setProperty","cachedStyle","cacheEntry","oldScopeSelector","cachedScopeSelector","applyElementStyle","v","_styleOwnerForNode","owner","ownerStyleInfo","hostAndRootProps","propertiesMatchingHost","propertyData","overrides","reify","styleSubtree","shadowChildren","documentRule","_transformRule","getComputedStyleValue","getComputedStyle","getPropertyValue","setElementClass","classString","scopeName","classAttr","k$","_styleInfoForNode","elementExtends","WebComponents","fire","ready","wait"],"mappings":"A;;;;;;;;;;;;;;;;;;aAWA,IAAA,CAAA,CCgCAA,EAb2B,WAAlB,EAAC,MAAO,OAAR,EAAiC,MAAjC,GAa0B,IAb1B,CAa0B,IAb1B,CAEe,WAAlB,EAAC,MAAO,OAAR,EAA2C,IAA3C,EAAiC,MAAjC,CAAmD,MAAnD,CAW6B,IDhCnC,CEyBAC,GAC4D,UAAxD,EAAsB,MAAO,OAAA,iBAA7B,CACA,MAAA,eADA,CAEA,QAAQ,CAAC,CAAD,CAAS,CAAT,CAAmB,CAAnB,CAA+B,CAOjC,CAAJ,EAAc,KAAA,UAAd,EAAiC,CAAjC,EAA2C,MAAA,UAA3C,GACA,CAAA,CAAO,CAAP,CADA,CACmB,CAAA,MADnB,CAPqC,CCZtB,SAAA,GAAQ,EAAG,CAE9BC,EAAA,CAAqB,QAAQ,EAAG,EAE3BF,EAAA,OAAL,GACEA,CAAA,OADF,CAC6BG,EAD7B,CAJ8B,CAehC,IAAAA,GAAuD,QAAQ,EAAG,CAChE,IAAI,EAAU,CAUd,OAJA,SAAe,CAAC,CAAD,CAAkB,CAC/B,MA9BoBC,gBA8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AA+C,SAAAmE,cAAA,CAA8B,IAAIoQ,WAAJ,CAAgB,oBAAhB,CAAsC,CAAEZ,QAAS,CAAA,CAAX,CAAtC,CAA9B,CAF0B,CAA5B,CADc,CAOhBgqB,QAASA,GAAI,EAAG,CACdF,EAAA,EACAz9B,GAAA+D,oBAAA,CAA6B,kBAA7B,CAAiD45B,EAAjD,CAFc,CAKY,SAA5B,GAAI39B,EAAA0d,WAAJ,CACE+f,EAAA,EADF,CAGEz9B,EAAA8D,iBAAA,CAA0B,kBAA1B,CAA8C65B,EAA9C","file":"webcomponents-sd-ce.js","sourcesContent":["/**\n@license\nCopyright (c) 2016 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\nexport class ShadyData {\n  constructor() {\n    /** @type {ShadowRoot} */\n    this.root = null;\n    /** @type {ShadowRoot} */\n    this.publicRoot = null;\n    this.dirty = false;\n    this.observer = null;\n    /** @type {Array<Node>} */\n    this.assignedNodes = null;\n    /** @type {Element} */\n    this.assignedSlot = null;\n    /** @type {Array<Node>} */\n    this._previouslyAssignedNodes = null;\n    /** @type {Element} */\n    this._prevAssignedSlot = null;\n    /** @type {Array<Node>} */\n    this.flattenedNodes = null;\n    this.ownerShadyRoot = undefined;\n    /** @type {Node|undefined} */\n    this.parentNode = undefined;\n    /** @type {Node|undefined} */\n    this.firstChild = undefined;\n    /** @type {Node|undefined} */\n    this.lastChild = undefined;\n    /** @type {Node|undefined} */\n    this.previousSibling = undefined;\n    /** @type {Node|undefined} */\n    this.nextSibling = undefined;\n    /** @type {Array<Node>|undefined} */\n    this.childNodes = undefined;\n    this.__outsideAccessors = false;\n    this.__insideAccessors = false;\n  }\n\n  toJSON() {\n    return {};\n  }\n}\n\nexport function ensureShadyDataForNode(node) {\n  if (!node.__shady) {\n    node.__shady = new ShadyData();\n  }\n  return node.__shady;\n}\n\nexport function shadyDataForNode(node) {\n  return node && node.__shady;\n}\n",null,null,null,null,null,"/**\n@license\nCopyright (c) 2016 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 {shadyDataForNode} from './shady-data.js';\n\nexport let settings = window['ShadyDOM'] || {};\n\nsettings.hasNativeShadowDOM = Boolean(Element.prototype.attachShadow && Node.prototype.getRootNode);\n\nlet desc = Object.getOwnPropertyDescriptor(Node.prototype, 'firstChild');\n\nsettings.hasDescriptors = Boolean(desc && desc.configurable && desc.get);\nsettings.inUse = settings['force'] || !settings.hasNativeShadowDOM;\n\n// Default to using native accessors (instead of treewalker) only for\n// IE/Edge where they are faster.\nconst IS_IE = navigator.userAgent.match('Trident');\nconst IS_EDGE = navigator.userAgent.match('Edge');\nif (settings.useNativeAccessors === undefined) {\n  settings.useNativeAccessors = settings.hasDescriptors && (IS_IE || IS_EDGE);\n}\n\nexport function isTrackingLogicalChildNodes(node) {\n  const nodeData = shadyDataForNode(node);\n  return (nodeData && nodeData.firstChild !== undefined);\n}\n\nexport function isShadyRoot(obj) {\n  return Boolean(obj._localName === 'ShadyRoot');\n}\n\nexport function ownerShadyRootForNode(node) {\n  let root = node.getRootNode();\n  if (isShadyRoot(root)) {\n    return root;\n  }\n}\n\nlet p = Element.prototype;\nlet matches = p.matches || p.matchesSelector ||\n  p.mozMatchesSelector || p.msMatchesSelector ||\n  p.oMatchesSelector || p.webkitMatchesSelector;\n\nexport function matchesSelector(element, selector) {\n  return matches.call(element, selector);\n}\n\nfunction copyOwnProperty(name, source, target) {\n  let pd = Object.getOwnPropertyDescriptor(source, name);\n  if (pd) {\n    Object.defineProperty(target, name, pd);\n  }\n}\n\nexport function extend(target, source) {\n  if (target && source) {\n    let n$ = Object.getOwnPropertyNames(source);\n    for (let i=0, n; (i<n$.length) && (n=n$[i]); i++) {\n      copyOwnProperty(n, source, target);\n    }\n  }\n  return target || source;\n}\n\nexport function extendAll(target, ...sources) {\n  for (let i=0; i < sources.length; i++) {\n    extend(target, sources[i]);\n  }\n  return target;\n}\n\nexport function mixin(target, source) {\n  for (var i in source) {\n    target[i] = source[i];\n  }\n  return target;\n}\n\nexport function patchPrototype(obj, mixin) {\n  let proto = Object.getPrototypeOf(obj);\n  if (!proto.hasOwnProperty('__patchProto')) {\n    let patchProto = Object.create(proto);\n    patchProto.__sourceProto = proto;\n    extend(patchProto, mixin);\n    proto['__patchProto'] = patchProto;\n  }\n  // old browsers don't have setPrototypeOf\n  obj.__proto__ = proto['__patchProto'];\n}\n\n\nlet twiddle = document.createTextNode('');\nlet content = 0;\nlet queue = [];\nnew MutationObserver(() => {\n  while (queue.length) {\n    // catch errors in user code...\n    try {\n      queue.shift()();\n    } catch(e) {\n      // enqueue another record and throw\n      twiddle.textContent = content++;\n      throw(e);\n    }\n  }\n}).observe(twiddle, {characterData: true});\n\n// use MutationObserver to get microtask async timing.\nexport function microtask(callback) {\n  queue.push(callback);\n  twiddle.textContent = content++;\n}\n\nexport const hasDocumentContains = Boolean(document.contains);\n\nexport function contains(container, node) {\n  while (node) {\n    if (node == container) {\n      return true;\n    }\n    node = node.parentNode;\n  }\n  return false;\n}\n","/**\n@license\nCopyright (c) 2016 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 * as utils from './utils.js';\n\n// render enqueuer/flusher\nlet flushList = [];\nlet scheduled;\nexport function enqueue(callback) {\n  if (!scheduled) {\n    scheduled = true;\n    utils.microtask(flush);\n  }\n  flushList.push(callback);\n}\n\nexport function flush() {\n  scheduled = false;\n  let didFlush = Boolean(flushList.length);\n  while (flushList.length) {\n    flushList.shift()();\n  }\n  return didFlush;\n}\n\nflush['list'] = flushList;\n","/**\n@license\nCopyright (c) 2016 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 * as utils from './utils.js';\nimport {ensureShadyDataForNode} from './shady-data.js';\n\nclass AsyncObserver {\n\n  constructor() {\n    this._scheduled = false;\n    this.addedNodes = [];\n    this.removedNodes = [];\n    this.callbacks = new Set();\n  }\n\n  schedule() {\n    if (!this._scheduled) {\n      this._scheduled = true;\n      utils.microtask(() => {\n        this.flush();\n      });\n    }\n  }\n\n  flush() {\n    if (this._scheduled) {\n      this._scheduled = false;\n      let mutations = this.takeRecords();\n      if (mutations.length) {\n        this.callbacks.forEach(function(cb) {\n          cb(mutations);\n        });\n      }\n    }\n  }\n\n  takeRecords() {\n    if (this.addedNodes.length || this.removedNodes.length) {\n      let mutations = [{\n        addedNodes: this.addedNodes,\n        removedNodes: this.removedNodes\n      }];\n      this.addedNodes = [];\n      this.removedNodes = [];\n      return mutations;\n    }\n    return [];\n  }\n\n}\n\n// TODO(sorvell): consider instead polyfilling MutationObserver\n// directly so that users do not have to fork their code.\n// Supporting the entire api may be challenging: e.g. filtering out\n// removed nodes in the wrong scope and seeing non-distributing\n// subtree child mutations.\nexport let observeChildren = function(node, callback) {\n  const sd = ensureShadyDataForNode(node);\n  if (!sd.observer) {\n    sd.observer = new AsyncObserver();\n  }\n  sd.observer.callbacks.add(callback);\n  let observer = sd.observer;\n  return {\n    _callback: callback,\n    _observer: observer,\n    _node: node,\n    takeRecords() {\n      return observer.takeRecords()\n    }\n  };\n}\n\nexport let unobserveChildren = function(handle) {\n  let observer = handle && handle._observer;\n  if (observer) {\n    observer.callbacks.delete(handle._callback);\n    if (!observer.callbacks.size) {\n      ensureShadyDataForNode(handle._node).observer = null;\n    }\n  }\n}\n\nexport function filterMutations(mutations, target) {\n  /** @const {Node} */\n  const targetRootNode = target.getRootNode();\n  return mutations.map(function(mutation) {\n    /** @const {boolean} */\n    const mutationInScope = (targetRootNode === mutation.target.getRootNode());\n    if (mutationInScope && mutation.addedNodes) {\n      let nodes = Array.from(mutation.addedNodes).filter(function(n) {\n        return (targetRootNode === n.getRootNode());\n      });\n      if (nodes.length) {\n        mutation = Object.create(mutation);\n        Object.defineProperty(mutation, 'addedNodes', {\n          value: nodes,\n          configurable: true\n        });\n        return mutation;\n      }\n    } else if (mutationInScope) {\n      return mutation;\n    }\n  }).filter(function(m) { return m});\n}\n","/**\n@license\nCopyright (c) 2016 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 let appendChild = Element.prototype.appendChild;\nexport let insertBefore = Element.prototype.insertBefore;\nexport let replaceChild = Element.prototype.replaceChild;\nexport let removeChild = Element.prototype.removeChild;\nexport let setAttribute = Element.prototype.setAttribute;\nexport let removeAttribute = Element.prototype.removeAttribute;\nexport let cloneNode = Element.prototype.cloneNode;\nexport let importNode = Document.prototype.importNode;\nexport let addEventListener = Element.prototype.addEventListener;\nexport let removeEventListener = Element.prototype.removeEventListener;\nexport let windowAddEventListener = Window.prototype.addEventListener;\nexport let windowRemoveEventListener = Window.prototype.removeEventListener;\nexport let dispatchEvent = Element.prototype.dispatchEvent;\nexport let contains = Node.prototype.contains || HTMLElement.prototype.contains;\nexport let getElementById = Document.prototype.getElementById;\nexport let elementQuerySelector = Element.prototype.querySelector;\nexport let fragmentQuerySelector = DocumentFragment.prototype.querySelector;\nexport let documentQuerySelector = Document.prototype.querySelector;\nexport let querySelector = function(selector) {\n  switch (this.nodeType) {\n    case Node.ELEMENT_NODE:\n      return elementQuerySelector.call(this, selector);\n    case Node.DOCUMENT_NODE:\n      return documentQuerySelector.call(this, selector);\n    default:\n      return fragmentQuerySelector.call(this, selector);\n  }\n};\nexport let elementQuerySelectorAll = Element.prototype.querySelectorAll;\nexport let fragmentQuerySelectorAll = DocumentFragment.prototype.querySelectorAll;\nexport let documentQuerySelectorAll = Document.prototype.querySelectorAll;\nexport let querySelectorAll = function(selector) {\n  switch (this.nodeType) {\n    case Node.ELEMENT_NODE:\n      return elementQuerySelectorAll.call(this, selector);\n    case Node.DOCUMENT_NODE:\n      return documentQuerySelectorAll.call(this, selector);\n    default:\n      return fragmentQuerySelectorAll.call(this, selector);\n  }\n};","/**\n@license\nCopyright (c) 2016 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// Cribbed from ShadowDOM polyfill\n// https://github.com/webcomponents/webcomponentsjs/blob/master/src/ShadowDOM/wrappers/HTMLElement.js#L28\n/////////////////////////////////////////////////////////////////////////////\n// innerHTML and outerHTML\n\n// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#escapingString\nlet escapeAttrRegExp = /[&\\u00A0\"]/g;\nlet escapeDataRegExp = /[&\\u00A0<>]/g;\n\nfunction escapeReplace(c) {\n  switch (c) {\n    case '&':\n      return '&amp;';\n    case '<':\n      return '&lt;';\n    case '>':\n      return '&gt;';\n    case '\"':\n      return '&quot;';\n    case '\\u00A0':\n      return '&nbsp;';\n  }\n}\n\nfunction escapeAttr(s) {\n  return s.replace(escapeAttrRegExp, escapeReplace);\n}\n\nfunction escapeData(s) {\n  return s.replace(escapeDataRegExp, escapeReplace);\n}\n\nfunction makeSet(arr) {\n  let set = {};\n  for (let i = 0; i < arr.length; i++) {\n    set[arr[i]] = true;\n  }\n  return set;\n}\n\n// http://www.whatwg.org/specs/web-apps/current-work/#void-elements\nlet voidElements = makeSet([\n  'area',\n  'base',\n  'br',\n  'col',\n  'command',\n  'embed',\n  'hr',\n  'img',\n  'input',\n  'keygen',\n  'link',\n  'meta',\n  'param',\n  'source',\n  'track',\n  'wbr'\n]);\n\nlet plaintextParents = makeSet([\n  'style',\n  'script',\n  'xmp',\n  'iframe',\n  'noembed',\n  'noframes',\n  'plaintext',\n  'noscript'\n]);\n\n/**\n * @param {Node} node\n * @param {Node} parentNode\n * @param {Function=} callback\n */\nexport function getOuterHTML(node, parentNode, callback) {\n  switch (node.nodeType) {\n    case Node.ELEMENT_NODE: {\n      let tagName = node.localName;\n      let s = '<' + tagName;\n      let attrs = node.attributes;\n      for (let i = 0, attr; (attr = attrs[i]); i++) {\n        s += ' ' + attr.name + '=\"' + escapeAttr(attr.value) + '\"';\n      }\n      s += '>';\n      if (voidElements[tagName]) {\n        return s;\n      }\n      return s + getInnerHTML(node, callback) + '</' + tagName + '>';\n    }\n    case Node.TEXT_NODE: {\n      let data = /** @type {Text} */ (node).data;\n      if (parentNode && plaintextParents[parentNode.localName]) {\n        return data;\n      }\n      return escapeData(data);\n    }\n    case Node.COMMENT_NODE: {\n      return '<!--' + /** @type {Comment} */ (node).data + '-->';\n    }\n    default: {\n      window.console.error(node);\n      throw new Error('not implemented');\n    }\n  }\n}\n\n/**\n * @param {Node} node\n * @param {Function=} callback\n */\nexport function getInnerHTML(node, callback) {\n  if (node.localName === 'template') {\n    node =  /** @type {HTMLTemplateElement} */ (node).content;\n  }\n  let s = '';\n  let c$ = callback ? callback(node) : node.childNodes;\n  for (let i=0, l=c$.length, child; (i<l) && (child=c$[i]); i++) {\n    s += getOuterHTML(child, node, callback);\n  }\n  return s;\n}\n","/**\n@license\nCopyright (c) 2016 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 {getInnerHTML} from './innerHTML.js';\n\nlet nodeWalker = document.createTreeWalker(document, NodeFilter.SHOW_ALL,\n  null, false);\n\nlet elementWalker = document.createTreeWalker(document, NodeFilter.SHOW_ELEMENT,\n  null, false);\n\nexport function parentNode(node) {\n  nodeWalker.currentNode = node;\n  return nodeWalker.parentNode();\n}\n\nexport function firstChild(node) {\n  nodeWalker.currentNode = node;\n  return nodeWalker.firstChild();\n}\n\nexport function lastChild(node) {\n  nodeWalker.currentNode = node;\n  return nodeWalker.lastChild();\n}\n\nexport function previousSibling(node) {\n  nodeWalker.currentNode = node;\n  return nodeWalker.previousSibling();\n}\n\nexport function nextSibling(node) {\n  nodeWalker.currentNode = node;\n  return nodeWalker.nextSibling();\n}\n\nexport function childNodes(node) {\n  let nodes = [];\n  nodeWalker.currentNode = node;\n  let n = nodeWalker.firstChild();\n  while (n) {\n    nodes.push(n);\n    n = nodeWalker.nextSibling();\n  }\n  return nodes;\n}\n\nexport function parentElement(node) {\n  elementWalker.currentNode = node;\n  return elementWalker.parentNode();\n}\n\nexport function firstElementChild(node) {\n  elementWalker.currentNode = node;\n  return elementWalker.firstChild();\n}\n\nexport function lastElementChild(node) {\n  elementWalker.currentNode = node;\n  return elementWalker.lastChild();\n}\n\nexport function previousElementSibling(node) {\n  elementWalker.currentNode = node;\n  return elementWalker.previousSibling();\n}\n\nexport function nextElementSibling(node) {\n  elementWalker.currentNode = node;\n  return elementWalker.nextSibling();\n}\n\nexport function children(node) {\n  let nodes = [];\n  elementWalker.currentNode = node;\n  let n = elementWalker.firstChild();\n  while (n) {\n    nodes.push(n);\n    n = elementWalker.nextSibling();\n  }\n  return nodes;\n}\n\nexport function innerHTML(node) {\n  return getInnerHTML(node, (n) => childNodes(n));\n}\n\nexport function textContent(node) {\n  /* eslint-disable no-case-declarations */\n  switch (node.nodeType) {\n    case Node.ELEMENT_NODE:\n    case Node.DOCUMENT_FRAGMENT_NODE:\n      let textWalker = document.createTreeWalker(node, NodeFilter.SHOW_TEXT,\n        null, false);\n      let content = '', n;\n      while ( (n = textWalker.nextNode()) ) {\n        // TODO(sorvell): can't use textContent since we patch it on Node.prototype!\n        // However, should probably patch it only on element.\n        content += n.nodeValue;\n      }\n      return content;\n    default:\n      return node.nodeValue;\n  }\n  /* eslint-enable */\n}\n","/**\n@license\nCopyright (c) 2016 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 * as utils from './utils.js';\n\nconst hasDescriptors = utils.settings.hasDescriptors;\n\n// Find descriptor on the \"lowest\" native prototype. Safe as these are not\n// overridden and we call these on nodes.\nconst nativeProtos = [Node.prototype, Element.prototype, HTMLElement.prototype];\n// note, avoid Array.find for IE11 compat.\nfunction findNativeProtoWithDescriptor(name) {\n  for (let i=0; i < nativeProtos.length; i++) {\n    const proto = nativeProtos[i];\n    if (proto.hasOwnProperty(name)) {\n      return proto;\n    }\n  }\n}\nfunction findNodeDescriptor(name) {\n  const proto = findNativeProtoWithDescriptor(name);\n  if (!proto) {\n    throw Error(`Could not find descriptor for ${name}`);\n  }\n  return Object.getOwnPropertyDescriptor(proto, name);\n}\n\nexport const nodeAccessors = hasDescriptors ? {\n  parentNode: findNodeDescriptor('parentNode'),\n  firstChild: findNodeDescriptor('firstChild'),\n  lastChild: findNodeDescriptor('lastChild'),\n  previousSibling: findNodeDescriptor('previousSibling'),\n  nextSibling: findNodeDescriptor('nextSibling'),\n  childNodes: findNodeDescriptor('childNodes'),\n  parentElement: findNodeDescriptor('parentElement'),\n  previousElementSibling: findNodeDescriptor('previousElementSibling'),\n  nextElementSibling: findNodeDescriptor('nextElementSibling'),\n  innerHTML: findNodeDescriptor('innerHTML'),\n  textContent: findNodeDescriptor('textContent'),\n  firstElementChild: findNodeDescriptor('firstElementChild'),\n  lastElementChild: findNodeDescriptor('lastElementChild'),\n  children: findNodeDescriptor('children'),\n} : {};\n\nexport const fragmentAccessors = hasDescriptors ? {\n  firstElementChild: Object.getOwnPropertyDescriptor(\n    DocumentFragment.prototype, 'firstElementChild'),\n  lastElementChild: Object.getOwnPropertyDescriptor(\n    DocumentFragment.prototype, 'lastElementChild'),\n  children: Object.getOwnPropertyDescriptor(\n    DocumentFragment.prototype, 'children')\n} : {};\n\nexport const documentAccessors = hasDescriptors ? {\n  firstElementChild: Object.getOwnPropertyDescriptor(\n    Document.prototype, 'firstElementChild'),\n  lastElementChild: Object.getOwnPropertyDescriptor(\n    Document.prototype, 'lastElementChild'),\n  children: Object.getOwnPropertyDescriptor(\n    Document.prototype, 'children')\n} : {};\n\nexport function parentNode(node) {\n  return nodeAccessors.parentNode.get.call(node);\n}\n\nexport function firstChild(node) {\n  return nodeAccessors.firstChild.get.call(node);\n}\n\nexport function lastChild(node) {\n  return nodeAccessors.lastChild.get.call(node);\n}\n\nexport function previousSibling(node) {\n  return nodeAccessors.previousSibling.get.call(node);\n}\n\nexport function nextSibling(node) {\n  return nodeAccessors.nextSibling.get.call(node);\n}\n\nexport function childNodes(node) {\n  return Array.prototype.slice.call(nodeAccessors.childNodes.get.call(node));\n}\n\nexport function parentElement(node) {\n  return nodeAccessors.parentElement.get.call(node);\n}\n\nexport function previousElementSibling(node) {\n  return nodeAccessors.previousElementSibling.get.call(node);\n}\n\nexport function nextElementSibling(node) {\n  return nodeAccessors.nextElementSibling.get.call(node);\n}\n\nexport function innerHTML(node) {\n  return nodeAccessors.innerHTML.get.call(node);\n}\n\nexport function textContent(node) {\n  return nodeAccessors.textContent.get.call(node);\n}\n\nexport function children(node) {\n  let children;\n  switch (node.nodeType) {\n    case Node.DOCUMENT_FRAGMENT_NODE:\n      children = fragmentAccessors.children.get.call(node);\n      break;\n    case Node.DOCUMENT_NODE:\n      children = documentAccessors.children.get.call(node);\n      break;\n    default:\n      children = nodeAccessors.children.get.call(node);\n      break;\n  }\n  return Array.prototype.slice.call(children);\n}\n\nexport function firstElementChild(node) {\n  switch (node.nodeType) {\n    case Node.DOCUMENT_FRAGMENT_NODE:\n      return fragmentAccessors.firstElementChild.get.call(node);\n    case Node.DOCUMENT_NODE:\n      return documentAccessors.firstElementChild.get.call(node);\n    default:\n      return nodeAccessors.firstElementChild.get.call(node);\n  }\n}\n\nexport function lastElementChild(node) {\n  switch (node.nodeType) {\n    case Node.DOCUMENT_FRAGMENT_NODE:\n      return fragmentAccessors.lastElementChild.get.call(node);\n    case Node.DOCUMENT_NODE:\n      return documentAccessors.lastElementChild.get.call(node);\n    default:\n      return nodeAccessors.lastElementChild.get.call(node);\n  }\n}","/**\n@license\nCopyright (c) 2016 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 * as nativeTreeWalker from './native-tree-walker.js';\nimport * as nativeTreeAccessors from './native-tree-accessors.js';\nimport * as utils from './utils.js';\n\nexport const accessors = utils.settings.useNativeAccessors ?\n    nativeTreeAccessors : nativeTreeWalker;","/**\n@license\nCopyright (c) 2016 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 * as utils from './utils.js';\nimport {getInnerHTML} from './innerHTML.js';\nimport {accessors as nativeTree} from './native-tree.js';\nimport {nodeAccessors as nativeAccessors} from './native-tree-accessors.js';\nimport {contains as nativeContains} from './native-methods.js';\nimport {ensureShadyDataForNode, shadyDataForNode} from './shady-data.js';\n\nfunction clearNode(node) {\n  while (node.firstChild) {\n    node.removeChild(node.firstChild);\n  }\n}\n\nconst hasDescriptors = utils.settings.hasDescriptors;\nconst inertDoc = document.implementation.createHTMLDocument('inert');\n\nconst nativeIsConnectedAccessors =\n/** @type {ObjectPropertyDescriptor} */(\n  Object.getOwnPropertyDescriptor(Node.prototype, 'isConnected')\n);\n\nconst nativeIsConnected = nativeIsConnectedAccessors && nativeIsConnectedAccessors.get;\n\nconst nativeActiveElementDescriptor =\n  /** @type {ObjectPropertyDescriptor} */(\n    Object.getOwnPropertyDescriptor(Document.prototype, 'activeElement')\n  );\nfunction getDocumentActiveElement() {\n  if (nativeActiveElementDescriptor && nativeActiveElementDescriptor.get) {\n    return nativeActiveElementDescriptor.get.call(document);\n  } else if (!utils.settings.hasDescriptors) {\n    return document.activeElement;\n  }\n}\n\nfunction activeElementForNode(node) {\n  let active = getDocumentActiveElement();\n  // In IE11, activeElement might be an empty object if the document is\n  // contained in an iframe.\n  // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10998788/\n  if (!active || !active.nodeType) {\n    return null;\n  }\n  let isShadyRoot = !!(utils.isShadyRoot(node));\n  if (node !== document) {\n    // If this node isn't a document or shady root, then it doesn't have\n    // an active element.\n    if (!isShadyRoot) {\n      return null;\n    }\n    // If this shady root's host is the active element or the active\n    // element is not a descendant of the host (in the composed tree),\n    // then it doesn't have an active element.\n    if (node.host === active ||\n        !nativeContains.call(node.host, active)) {\n      return null;\n    }\n  }\n  // This node is either the document or a shady root of which the active\n  // element is a (composed) descendant of its host; iterate upwards to\n  // find the active element's most shallow host within it.\n  let activeRoot = utils.ownerShadyRootForNode(active);\n  while (activeRoot && activeRoot !== node) {\n    active = activeRoot.host;\n    activeRoot = utils.ownerShadyRootForNode(active);\n  }\n  if (node === document) {\n    // This node is the document, so activeRoot should be null.\n    return activeRoot ? null : active;\n  } else {\n    // This node is a non-document shady root, and it should be\n    // activeRoot.\n    return activeRoot === node ? active : null;\n  }\n}\n\nlet OutsideAccessors = {\n\n  parentElement: {\n    /** @this {Node} */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      let l = nodeData && nodeData.parentNode;\n      if (l && l.nodeType !== Node.ELEMENT_NODE) {\n        l = null;\n      }\n      return l !== undefined ? l : nativeTree.parentElement(this);\n    },\n    configurable: true\n  },\n\n  parentNode: {\n    /** @this {Node} */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      const l = nodeData && nodeData.parentNode;\n      return l !== undefined ? l : nativeTree.parentNode(this);\n    },\n    configurable: true\n  },\n\n  nextSibling: {\n    /** @this {Node} */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      const l = nodeData && nodeData.nextSibling;\n      return l !== undefined ? l : nativeTree.nextSibling(this);\n    },\n    configurable: true\n  },\n\n  previousSibling: {\n    /** @this {Node} */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      const l = nodeData && nodeData.previousSibling;\n      return l !== undefined ? l : nativeTree.previousSibling(this);\n    },\n    configurable: true\n  },\n\n  // fragment, element, document\n  nextElementSibling: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      if (nodeData && nodeData.nextSibling !== undefined) {\n        let n = this.nextSibling;\n        while (n && n.nodeType !== Node.ELEMENT_NODE) {\n          n = n.nextSibling;\n        }\n        return n;\n      } else {\n        return nativeTree.nextElementSibling(this);\n      }\n    },\n    configurable: true\n  },\n\n  previousElementSibling: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      if (nodeData && nodeData.previousSibling !== undefined) {\n        let n = this.previousSibling;\n        while (n && n.nodeType !== Node.ELEMENT_NODE) {\n          n = n.previousSibling;\n        }\n        return n;\n      } else {\n        return nativeTree.previousElementSibling(this);\n      }\n    },\n    configurable: true\n  }\n\n};\n\nexport const ClassNameAccessor = {\n  className: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      return this.getAttribute('class') || '';\n    },\n    /**\n     * @this {HTMLElement}\n     */\n    set(value) {\n      this.setAttribute('class', value);\n    },\n    configurable: true\n  }\n}\n\nexport const IsConnectedAccessor = {\n\n  isConnected: {\n    /**\n     * @this {Node}\n     */\n    get() {\n      if (nativeIsConnected && nativeIsConnected.call(this)) {\n        return true;\n      }\n      if (this.nodeType == Node.DOCUMENT_FRAGMENT_NODE) {\n        return false;\n      }\n      // Fast path for distributed nodes.\n      const ownerDocument = this.ownerDocument;\n      if (utils.hasDocumentContains) {\n        if (nativeContains.call(ownerDocument, this)) {\n          return true;\n        }\n      } else if (ownerDocument.documentElement &&\n        nativeContains.call(ownerDocument.documentElement, this)) {\n        return true;\n      }\n      // Slow path for non-distributed nodes.\n      let node = this;\n      while (node && !(node instanceof Document)) {\n        node = node.parentNode || (utils.isShadyRoot(node) ? /** @type {ShadowRoot} */(node).host : undefined);\n      }\n      return !!(node && node instanceof Document);\n    },\n    configurable: true\n  }\n};\n\nlet InsideAccessors = {\n\n  childNodes: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      let childNodes;\n      if (utils.isTrackingLogicalChildNodes(this)) {\n        const nodeData = shadyDataForNode(this);\n        if (!nodeData.childNodes) {\n          nodeData.childNodes = [];\n          for (let n=this.firstChild; n; n=n.nextSibling) {\n            nodeData.childNodes.push(n);\n          }\n        }\n        childNodes = nodeData.childNodes;\n      } else {\n        childNodes = nativeTree.childNodes(this);\n      }\n      childNodes.item = function(index) {\n        return childNodes[index];\n      }\n      return childNodes;\n    },\n    configurable: true\n  },\n\n  childElementCount: {\n    /** @this {HTMLElement} */\n    get() {\n      return this.children.length;\n    },\n    configurable: true\n  },\n\n  firstChild: {\n    /** @this {HTMLElement} */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      const l = nodeData && nodeData.firstChild;\n      return l !== undefined ? l : nativeTree.firstChild(this);\n    },\n    configurable: true\n  },\n\n  lastChild: {\n  /** @this {HTMLElement} */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      const l = nodeData && nodeData.lastChild;\n      return l !== undefined ? l : nativeTree.lastChild(this);\n    },\n    configurable: true\n  },\n\n  textContent: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      if (utils.isTrackingLogicalChildNodes(this)) {\n        let tc = [];\n        for (let i = 0, cn = this.childNodes, c; (c = cn[i]); i++) {\n          if (c.nodeType !== Node.COMMENT_NODE) {\n            tc.push(c.textContent);\n          }\n        }\n        return tc.join('');\n      } else {\n        return nativeTree.textContent(this);\n      }\n    },\n    /**\n     * @this {HTMLElement}\n     * @param {string} text\n     */\n    set(text) {\n      if (typeof text === 'undefined' || text === null) {\n        text = ''\n      }\n      switch (this.nodeType) {\n        case Node.ELEMENT_NODE:\n        case Node.DOCUMENT_FRAGMENT_NODE:\n          if (!utils.isTrackingLogicalChildNodes(this) && hasDescriptors) {\n            // may be removing a nested slot but fast path if we know we are not.\n            const firstChild = this.firstChild;\n            if (firstChild != this.lastChild ||\n              (firstChild && firstChild.nodeType != Node.TEXT_NODE)) {\n              clearNode(this);\n            }\n            nativeAccessors.textContent.set.call(this, text);\n          } else {\n            clearNode(this);\n            // Document fragments must have no childnodes if setting a blank string\n            if (text.length > 0 || this.nodeType === Node.ELEMENT_NODE) {\n              this.appendChild(document.createTextNode(text));\n            }\n          }\n          break;\n        default:\n          // TODO(sorvell): can't do this if patch nodeValue.\n          this.nodeValue = text;\n          break;\n      }\n    },\n    configurable: true\n  },\n\n  // fragment, element, document\n  firstElementChild: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      if (nodeData && nodeData.firstChild !== undefined) {\n        let n = this.firstChild;\n        while (n && n.nodeType !== Node.ELEMENT_NODE) {\n          n = n.nextSibling;\n        }\n        return n;\n      } else {\n        return nativeTree.firstElementChild(this);\n      }\n    },\n    configurable: true\n  },\n\n  lastElementChild: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      if (nodeData && nodeData.lastChild !== undefined) {\n        let n = this.lastChild;\n        while (n && n.nodeType !== Node.ELEMENT_NODE) {\n          n = n.previousSibling;\n        }\n        return n;\n      } else {\n        return nativeTree.lastElementChild(this);\n      }\n    },\n    configurable: true\n  },\n\n  children: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      let children;\n      if (utils.isTrackingLogicalChildNodes(this)) {\n        children = Array.prototype.filter.call(this.childNodes, function(n) {\n          return (n.nodeType === Node.ELEMENT_NODE);\n        });\n      } else {\n        children = nativeTree.children(this);\n      }\n      children.item = function(index) {\n        return children[index];\n      }\n      return children;\n    },\n    configurable: true\n  },\n\n  // element (HTMLElement on IE11)\n  innerHTML: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      if (utils.isTrackingLogicalChildNodes(this)) {\n        const content = this.localName === 'template' ?\n        /** @type {HTMLTemplateElement} */(this).content : this;\n        return getInnerHTML(content);\n      } else {\n        return nativeTree.innerHTML(this);\n      }\n    },\n    /**\n     * @this {HTMLElement}\n     */\n    set(text) {\n      const content = this.localName === 'template' ?\n        /** @type {HTMLTemplateElement} */(this).content : this;\n      clearNode(content);\n      let containerName = this.localName;\n      // avoid creating a template so we don't have to pull nodes form `.content`\n      if (!containerName || containerName === 'template') {\n        containerName = 'div';\n      }\n      const htmlContainer = inertDoc.createElement(containerName);\n      if (hasDescriptors) {\n        nativeAccessors.innerHTML.set.call(htmlContainer, text);\n      } else {\n        htmlContainer.innerHTML = text;\n      }\n      while (htmlContainer.firstChild) {\n        content.appendChild(htmlContainer.firstChild);\n      }\n    },\n    configurable: true\n  }\n\n};\n\n// Note: Can be patched on element prototype on all browsers.\n// Must be patched on instance on browsers that support native Shadow DOM\n// but do not have builtin accessors (old Chrome).\nexport let ShadowRootAccessor = {\n\n  shadowRoot: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      const nodeData = shadyDataForNode(this);\n      return nodeData && nodeData.publicRoot || null;\n    },\n    configurable: true\n  }\n};\n\n// Note: Can be patched on document prototype on browsers with builtin accessors.\n// Must be patched separately on simulated ShadowRoot.\n// Must be patched as `_activeElement` on browsers without builtin accessors.\nexport let ActiveElementAccessor = {\n\n  activeElement: {\n    /**\n     * @this {HTMLElement}\n     */\n    get() {\n      return activeElementForNode(this);\n    },\n    /**\n     * @this {HTMLElement}\n     */\n    set() {},\n    configurable: true\n  }\n\n};\n\n// patch a group of descriptors on an object only if it exists or if the `force`\n// argument is true.\n/**\n * @param {!Object} obj\n * @param {!Object} descriptors\n * @param {boolean=} force\n */\nfunction patchAccessorGroup(obj, descriptors, force) {\n  for (let p in descriptors) {\n    let objDesc = Object.getOwnPropertyDescriptor(obj, p);\n    if ((objDesc && objDesc.configurable) ||\n      (!objDesc && force)) {\n      Object.defineProperty(obj, p, descriptors[p]);\n    } else if (force) {\n      console.warn('Could not define', p, 'on', obj); // eslint-disable-line no-console\n    }\n  }\n}\n\n// patch dom accessors on proto where they exist\nexport function patchAccessors(proto) {\n  patchAccessorGroup(proto, OutsideAccessors);\n  patchAccessorGroup(proto, ClassNameAccessor);\n  patchAccessorGroup(proto, InsideAccessors);\n  patchAccessorGroup(proto, ActiveElementAccessor);\n}\n\nexport function patchShadowRootAccessors(proto) {\n  proto.__proto__ = DocumentFragment.prototype;\n  // ensure element descriptors (IE/Edge don't have em)\n  patchAccessorGroup(proto, OutsideAccessors, true);\n  patchAccessorGroup(proto, InsideAccessors, true);\n  patchAccessorGroup(proto, ActiveElementAccessor, true);\n  // Ensure native properties are all safely wrapped since ShadowRoot is not an\n  // actual DocumentFragment instance.\n  Object.defineProperties(proto, {\n    nodeType: {\n      value: Node.DOCUMENT_FRAGMENT_NODE,\n      configurable: true\n    },\n    nodeName: {\n      value: '#document-fragment',\n      configurable: true\n    },\n    nodeValue: {\n      value: null,\n      configurable: true\n    }\n  });\n  // make undefined\n  [\n    'localName',\n    'namespaceURI',\n    'prefix'\n  ].forEach((prop) => {\n    Object.defineProperty(proto, prop, {\n      value: undefined,\n      configurable: true\n    });\n  });\n  // defer properties to host\n  [\n    'ownerDocument',\n    'baseURI',\n    'isConnected'\n  ].forEach((prop) => {\n    Object.defineProperty(proto, prop, {\n      get() {\n        return this.host[prop];\n      },\n      configurable: true\n    });\n  });\n}\n\n// ensure an element has patched \"outside\" accessors; no-op when not needed\nexport let patchOutsideElementAccessors = utils.settings.hasDescriptors ?\n  function() {} : function(element) {\n    const sd = ensureShadyDataForNode(element);\n    if (!sd.__outsideAccessors) {\n      sd.__outsideAccessors = true;\n      patchAccessorGroup(element, OutsideAccessors, true);\n      patchAccessorGroup(element, ClassNameAccessor, true);\n    }\n  }\n\n// ensure an element has patched \"inside\" accessors; no-op when not needed\nexport let patchInsideElementAccessors = utils.settings.hasDescriptors ?\n  function() {} : function(element) {\n    const sd = ensureShadyDataForNode(element);\n    if (!sd.__insideAccessors) {\n      patchAccessorGroup(element, InsideAccessors, true);\n      patchAccessorGroup(element, ShadowRootAccessor, true);\n    }\n  }\n","/**\n@license\nCopyright (c) 2016 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 {calculateSplices} from './array-splice.js';\nimport * as utils from './utils.js';\nimport {enqueue} from './flush.js';\nimport {recordChildNodes} from './logical-tree.js';\nimport {removeChild, insertBefore, dispatchEvent} from './native-methods.js';\nimport {accessors} from './native-tree.js';\nimport {ensureShadyDataForNode, shadyDataForNode} from './shady-data.js';\n\nconst {parentNode, childNodes} = accessors;\n\n// Do not export this object. It must be passed as the first argument to the\n// ShadyRoot constructor in `attachShadow` to prevent the constructor from\n// throwing. This prevents the user from being able to manually construct a\n// ShadyRoot (i.e. `new ShadowRoot()`).\nconst ShadyRootConstructionToken = {};\n\nconst CATCHALL_NAME = '__catchall';\nconst SHADYROOT_NAME = 'ShadyRoot';\n\nconst MODE_CLOSED = 'closed';\n\nfunction ancestorList(node) {\n  let ancestors = [];\n  do {\n    ancestors.unshift(node);\n  } while ((node = node.parentNode));\n  return ancestors;\n}\n\n/**\n * @constructor\n * @extends {ShadowRoot}\n */\nexport class ShadyRoot {\n\n  constructor(token, host, options) {\n    if (token !== ShadyRootConstructionToken) {\n      throw new TypeError('Illegal constructor');\n    }\n    // NOTE: set a fake local name so this element can be\n    // distinguished from a DocumentFragment when patching.\n    // FF doesn't allow this to be `localName`\n    this._localName = SHADYROOT_NAME;\n    const c$ = childNodes(host);\n    // root <=> host\n    this.host = host;\n    this._mode = options && options.mode;\n    // logical dom setup\n    recordChildNodes(host, c$);\n    const hostData = shadyDataForNode(host);\n    hostData.root = this;\n    hostData.publicRoot = this._mode !== MODE_CLOSED ? this : null;\n    // setup root\n    const rootData = ensureShadyDataForNode(this);\n    rootData.firstChild = rootData.lastChild =\n        rootData.parentNode = rootData.nextSibling =\n        rootData.previousSibling = null;\n    rootData.childNodes = [];\n    // state flags\n    this._renderPending = false;\n    this._hasRendered = false;\n    // marsalled lazily\n    this._slotList = null;\n    this._slotMap = null;\n    this._pendingSlots = null;\n    // fast path initial render: remove existing physical dom.\n    for (let i=0, l=c$.length; i < l; i++) {\n      removeChild.call(host, c$[i])\n    }\n  }\n\n  // async render\n  _asyncRender() {\n    if (!this._renderPending) {\n      this._renderPending = true;\n      enqueue(() => this._render());\n    }\n  }\n\n  // returns the oldest renderPending ancestor root.\n  _getRenderRoot() {\n    let renderRoot;\n    let root = this;\n    while (root) {\n      if (root._renderPending) {\n        renderRoot = root;\n      }\n      root = root._rendererForHost();\n    }\n    return renderRoot;\n  }\n\n  // Returns the shadyRoot `this.host` if `this.host`\n  // has children that require distribution.\n  _rendererForHost() {\n    let root = this.host.getRootNode();\n    if (utils.isShadyRoot(root)) {\n      let c$ = this.host.childNodes;\n      for (let i=0, c; i < c$.length; i++) {\n        c = c$[i];\n        if (this._isInsertionPoint(c)) {\n          return root;\n        }\n      }\n    }\n  }\n\n  _render() {\n    const root = this._getRenderRoot();\n    if (root) {\n      root['_renderRoot']();\n    }\n  }\n\n  // NOTE: avoid renaming to ease testability.\n  ['_renderRoot']() {\n    this._renderPending = false;\n    if (this._slotList) {\n      this._distribute();\n      this._compose();\n    }\n    this._hasRendered = true;\n  }\n\n  _distribute() {\n    this._validateSlots();\n    // capture # of previously assigned nodes to help determine if dirty.\n    for (let i=0, slot; i < this._slotList.length; i++) {\n      slot = this._slotList[i];\n      this._clearSlotAssignedNodes(slot);\n    }\n    // distribute host children.\n    for (let n=this.host.firstChild; n; n=n.nextSibling) {\n      this._distributeNodeToSlot(n);\n    }\n    // fallback content, slotchange, and dirty roots\n    for (let i=0; i < this._slotList.length; i++) {\n      const slot = this._slotList[i];\n      const slotData = shadyDataForNode(slot);\n      // distribute fallback content\n      if (!slotData.assignedNodes.length) {\n        for (let n=slot.firstChild; n; n=n.nextSibling) {\n          this._distributeNodeToSlot(n, slot);\n        }\n      }\n      const slotParentData = shadyDataForNode(slot.parentNode);\n      const slotParentRoot = slotParentData && slotParentData.root;\n      if (slotParentRoot && slotParentRoot._hasInsertionPoint()) {\n        slotParentRoot['_renderRoot']();\n      }\n      this._addAssignedToFlattenedNodes(slotData.flattenedNodes,\n        slotData.assignedNodes);\n      let prevAssignedNodes = slotData._previouslyAssignedNodes;\n      if (prevAssignedNodes) {\n        for (let i=0; i < prevAssignedNodes.length; i++) {\n          shadyDataForNode(prevAssignedNodes[i])._prevAssignedSlot = null;\n        }\n        slotData._previouslyAssignedNodes = null;\n        // dirty if previously less assigned nodes than previously assigned.\n        if (prevAssignedNodes.length > slotData.assignedNodes.length) {\n          slotData.dirty = true;\n        }\n      }\n      /* Note: A slot is marked dirty whenever a node is newly assigned to it\n      or a node is assigned to a different slot (done in `_distributeNodeToSlot`)\n      or if the number of nodes assigned to the slot has decreased (done above);\n      */\n      if (slotData.dirty) {\n        slotData.dirty = false;\n        this._fireSlotChange(slot);\n      }\n    }\n  }\n\n  /**\n   * Distributes given `node` to the appropriate slot based on its `slot`\n   * attribute. If `forcedSlot` is given, then the node is distributed to the\n   * `forcedSlot`.\n   * Note: slot to which the node is assigned will be marked dirty for firing\n   * `slotchange`.\n   * @param {Node} node\n   * @param {Node=} forcedSlot\n   *\n   */\n  _distributeNodeToSlot(node, forcedSlot) {\n    const nodeData = ensureShadyDataForNode(node);\n    let oldSlot = nodeData._prevAssignedSlot;\n    nodeData._prevAssignedSlot = null;\n    let slot = forcedSlot;\n    if (!slot) {\n      let name = node.slot || CATCHALL_NAME;\n      const list = this._slotMap[name];\n      slot = list && list[0];\n    }\n    if (slot) {\n      const slotData = ensureShadyDataForNode(slot);\n      slotData.assignedNodes.push(node);\n      nodeData.assignedSlot = slot;\n    } else {\n      nodeData.assignedSlot = undefined;\n    }\n    if (oldSlot !== nodeData.assignedSlot) {\n      if (nodeData.assignedSlot) {\n        ensureShadyDataForNode(nodeData.assignedSlot).dirty = true;\n      }\n    }\n  }\n\n  /**\n   * Clears the assignedNodes tracking data for a given `slot`. Note, the current\n   * assigned node data is tracked (via _previouslyAssignedNodes and\n   * _prevAssignedSlot) to see if `slotchange` should fire. This data may be out\n   *  of date at this time because the assigned nodes may have already been\n   * distributed to another root. This is ok since this data is only used to\n   * track changes.\n   * @param {HTMLSlotElement} slot\n   */\n  _clearSlotAssignedNodes(slot) {\n    const slotData = shadyDataForNode(slot);\n    let n$ = slotData.assignedNodes;\n    slotData.assignedNodes = [];\n    slotData.flattenedNodes = [];\n    slotData._previouslyAssignedNodes = n$;\n    if (n$) {\n      for (let i=0; i < n$.length; i++) {\n        let n = shadyDataForNode(n$[i]);\n        n._prevAssignedSlot = n.assignedSlot;\n        // only clear if it was previously set to this slot;\n        // this helps ensure that if the node has otherwise been distributed\n        // ignore it.\n        if (n.assignedSlot === slot) {\n          n.assignedSlot = null;\n        }\n      }\n    }\n  }\n\n  _addAssignedToFlattenedNodes(flattened, assigned) {\n    for (let i=0, n; (i<assigned.length) && (n=assigned[i]); i++) {\n      if (n.localName == 'slot') {\n        const nestedAssigned = shadyDataForNode(n).assignedNodes;\n        if (nestedAssigned && nestedAssigned.length) {\n          this._addAssignedToFlattenedNodes(flattened, nestedAssigned);\n        }\n      } else {\n        flattened.push(assigned[i]);\n      }\n    }\n  }\n\n  _fireSlotChange(slot) {\n    // NOTE: cannot bubble correctly here so not setting bubbles: true\n    // Safari tech preview does not bubble but chrome does\n    // Spec says it bubbles (https://dom.spec.whatwg.org/#mutation-observers)\n    dispatchEvent.call(slot, new Event('slotchange'));\n    const slotData = shadyDataForNode(slot);\n    if (slotData.assignedSlot) {\n      this._fireSlotChange(slotData.assignedSlot);\n    }\n  }\n\n  // Reify dom such that it is at its correct rendering position\n  // based on logical distribution.\n  // NOTE: here we only compose parents of <slot> elements and not the\n  // shadowRoot into the host. The latter is performend via a fast path\n  // in the `logical-mutation`.insertBefore.\n  _compose() {\n    const slots = this._slotList;\n    let composeList = [];\n    for (let i=0; i < slots.length; i++) {\n      const parent = slots[i].parentNode;\n      /* compose node only if:\n        (1) parent does not have a shadowRoot since shadowRoot has already\n        composed into the host\n        (2) we're not already composing it\n        [consider (n^2) but rare better than Set]\n      */\n      const parentData = shadyDataForNode(parent);\n      if (!(parentData && parentData.root) &&\n        composeList.indexOf(parent) < 0) {\n        composeList.push(parent);\n      }\n    }\n    for (let i=0; i < composeList.length; i++) {\n      const node = composeList[i];\n      const targetNode = node === this ? this.host : node;\n      this._updateChildNodes(targetNode, this._composeNode(node));\n    }\n  }\n\n  // Returns the list of nodes which should be rendered inside `node`.\n  _composeNode(node) {\n    let children = [];\n    let c$ = node.childNodes;\n    for (let i = 0; i < c$.length; i++) {\n      let child = c$[i];\n      // Note: if we see a slot here, the nodes are guaranteed to need to be\n      // composed here. This is because if there is redistribution, it has\n      // already been handled by this point.\n      if (this._isInsertionPoint(child)) {\n        let flattenedNodes = shadyDataForNode(child).flattenedNodes;\n        for (let j = 0; j < flattenedNodes.length; j++) {\n          let distributedNode = flattenedNodes[j];\n            children.push(distributedNode);\n        }\n      } else {\n        children.push(child);\n      }\n    }\n    return children;\n  }\n\n  _isInsertionPoint(node) {\n      return node.localName == 'slot';\n    }\n\n  // Ensures that the rendered node list inside `container` is `children`.\n  _updateChildNodes(container, children) {\n    let composed = childNodes(container);\n    let splices = calculateSplices(children, composed);\n    // process removals\n    for (let i=0, d=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        // check if the node is still where we expect it is before trying\n        // to remove it; this can happen if we move a node and\n        // then schedule its previous host for distribution resulting in\n        // the node being removed here.\n        if (parentNode(n) === container) {\n          removeChild.call(container, n);\n        }\n        // TODO(sorvell): avoid the need for splicing here.\n        composed.splice(s.index + d, 1);\n      }\n      d -= s.addedCount;\n    }\n    // process adds\n    for (let i=0, s, next; (i<splices.length) && (s=splices[i]); i++) { //eslint-disable-line no-redeclare\n      next = composed[s.index];\n      for (let j=s.index, n; j < s.index + s.addedCount; j++) {\n        n = children[j];\n        insertBefore.call(container, n, next);\n        composed.splice(j, 0, n);\n      }\n    }\n  }\n\n  _ensureSlotData() {\n    this._pendingSlots = this._pendingSlots || [];\n    this._slotList = this._slotList || [];\n    this._slotMap = this._slotMap || {};\n  }\n\n  _addSlots(slots) {\n    this._ensureSlotData();\n    this._pendingSlots.push(...slots);\n  }\n\n  _validateSlots() {\n    if (this._pendingSlots && this._pendingSlots.length) {\n      this._mapSlots(this._pendingSlots);\n      this._pendingSlots = [];\n    }\n  }\n\n  /**\n   * Adds the given slots. Slots are maintained in an dom-ordered list.\n   * In addition a map of name to slot is updated.\n   */\n  _mapSlots(slots) {\n    let slotNamesToSort;\n    for (let i=0; i < slots.length; i++) {\n      let slot = slots[i];\n      // ensure insertionPoints's and their parents have logical dom info.\n      // save logical tree info\n      // a. for shadyRoot\n      // b. for insertion points (fallback)\n      // c. for parents of insertion points\n      recordChildNodes(slot);\n      recordChildNodes(slot.parentNode);\n      let name = this._nameForSlot(slot);\n      if (this._slotMap[name]) {\n        slotNamesToSort = slotNamesToSort || {};\n        slotNamesToSort[name] = true;\n        this._slotMap[name].push(slot);\n      } else {\n        this._slotMap[name] = [slot];\n      }\n      this._slotList.push(slot);\n    }\n    if (slotNamesToSort) {\n      for (let n in slotNamesToSort) {\n        this._slotMap[n] = this._sortSlots(this._slotMap[n]);\n      }\n    }\n  }\n\n  _nameForSlot(slot) {\n    const name = slot['name'] || slot.getAttribute('name') || CATCHALL_NAME;\n    slot.__slotName = name;\n    return name;\n  }\n\n  /**\n   * Slots are kept in an ordered list. Slots with the same name\n   * are sorted here by tree order.\n   */\n  _sortSlots(slots) {\n    // NOTE: Cannot use `compareDocumentPosition` because it's not polyfilled,\n    // but the code here could be used to polyfill the preceeding/following info\n    // in `compareDocumentPosition`.\n    return slots.sort((a, b) => {\n      let listA = ancestorList(a);\n      let listB = ancestorList(b);\n      for (var i=0; i < listA.length; i++) {\n        let nA = listA[i];\n        let nB = listB[i];\n        if (nA !== nB) {\n          let c$ = Array.from(nA.parentNode.childNodes);\n          return c$.indexOf(nA) - c$.indexOf(nB);\n        }\n      }\n    });\n  }\n\n  /**\n   * Removes from tracked slot data any slots contained within `container` and\n   * then updates the tracked data (_slotList and _slotMap).\n   * Any removed slots also have their `assignedNodes` removed from comopsed dom.\n   */\n  _removeContainedSlots(container) {\n    if (!this._slotList) {\n      return;\n    }\n    this._validateSlots();\n    let didRemove;\n    const map = this._slotMap;\n    for (let n in map) {\n      let slots = map[n];\n      for (let i=0; i < slots.length; i++) {\n        let slot = slots[i];\n        if (utils.contains(container, slot)) {\n          slots.splice(i, 1);\n          const x = this._slotList.indexOf(slot);\n          if (x >= 0) {\n            this._slotList.splice(x, 1);\n          }\n          i--;\n          this._removeFlattenedNodes(slot);\n          didRemove = true;\n        }\n      }\n    }\n    return didRemove;\n  }\n\n  _updateSlotName(slot) {\n    if (!this._slotList) {\n      return;\n    }\n    const oldName = slot.__slotName;\n    const name = this._nameForSlot(slot);\n    if (name === oldName) {\n      return;\n    }\n    // remove from existing tracking\n    let slots = this._slotMap[oldName];\n    const i = slots.indexOf(slot);\n    if (i >= 0) {\n      slots.splice(i, 1);\n    }\n    // add to new location and sort if nedessary\n    let list = this._slotMap[name] || (this._slotMap[name] = []);\n    list.push(slot);\n    if (list.length > 1) {\n      this._slotMap[name] = this._sortSlots(list);\n    }\n  }\n\n  _removeFlattenedNodes(slot) {\n    const data = shadyDataForNode(slot);\n    let n$ = data.flattenedNodes;\n    if (n$) {\n      for (let i=0; i<n$.length; i++) {\n        let node = n$[i];\n        let parent = parentNode(node);\n        if (parent) {\n          removeChild.call(parent, node);\n        }\n      }\n    }\n    data.flattenedNodes = [];\n    data.assignedNodes = [];\n  }\n\n  _hasInsertionPoint() {\n    this._validateSlots();\n    return Boolean(this._slotList && this._slotList.length);\n  }\n}\n\n/**\n  Implements a pared down version of ShadowDOM's scoping, which is easy to\n  polyfill across browsers.\n*/\nexport function attachShadow(host, options) {\n  if (!host) {\n    throw 'Must provide a host.';\n  }\n  if (!options) {\n    throw 'Not enough arguments.'\n  }\n  return new ShadyRoot(ShadyRootConstructionToken, host, options);\n}\n","/**\n@license\nCopyright (c) 2016 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 * as utils from './utils.js';\nimport {flush} from './flush.js';\nimport {dispatchEvent, querySelectorAll} from './native-methods.js';\nimport * as mutation from './logical-mutation.js';\nimport {ActiveElementAccessor, ShadowRootAccessor, patchAccessors, patchShadowRootAccessors, IsConnectedAccessor} from './patch-accessors.js';\nimport {addEventListener, removeEventListener} from './patch-events.js';\nimport {attachShadow, ShadyRoot} from './attach-shadow.js';\nimport {shadyDataForNode} from './shady-data.js';\n\nfunction getAssignedSlot(node) {\n  mutation.renderRootNode(node);\n  const nodeData = shadyDataForNode(node);\n  return nodeData && nodeData.assignedSlot || null;\n}\n\nlet windowMixin = {\n\n  // NOTE: ensure these methods are bound to `window` so that `this` is correct\n  // when called directly from global context without a receiver; e.g.\n  // `addEventListener(...)`.\n  addEventListener: addEventListener.bind(window),\n\n  removeEventListener: removeEventListener.bind(window)\n\n};\n\nlet nodeMixin = {\n\n  addEventListener: addEventListener,\n\n  removeEventListener: removeEventListener,\n\n  appendChild(node) {\n    return mutation.insertBefore(this, node);\n  },\n\n  insertBefore(node, ref_node) {\n    return mutation.insertBefore(this, node, ref_node);\n  },\n\n  removeChild(node) {\n    return mutation.removeChild(this, node);\n  },\n\n  /**\n   * @this {Node}\n   */\n  replaceChild(node, ref_node) {\n    mutation.insertBefore(this, node, ref_node);\n    mutation.removeChild(this, ref_node);\n    return node;\n  },\n\n  /**\n   * @this {Node}\n   */\n  cloneNode(deep) {\n    return mutation.cloneNode(this, deep);\n  },\n\n  /**\n   * @this {Node}\n   */\n  getRootNode(options) {\n    return mutation.getRootNode(this, options);\n  },\n\n  contains(node) {\n    return utils.contains(this, node);\n  },\n\n  /**\n   * @this {Node}\n   */\n  dispatchEvent(event) {\n    flush();\n    return dispatchEvent.call(this, event);\n  }\n\n};\n\n// NOTE: we can do this regardless of the browser supporting native accessors\n// since this is always \"new\" in that case.\nObject.defineProperties(nodeMixin, IsConnectedAccessor);\n\n// NOTE: For some reason 'Text' redefines 'assignedSlot'\nlet textMixin = {\n  /**\n   * @this {Text}\n   */\n  get assignedSlot() {\n    return getAssignedSlot(this);\n  }\n};\n\nlet fragmentMixin = {\n\n  // TODO(sorvell): consider doing native QSA and filtering results.\n  /**\n   * @this {DocumentFragment}\n   */\n  querySelector(selector) {\n    // match selector and halt on first result.\n    let result = mutation.query(this, function(n) {\n      return utils.matchesSelector(n, selector);\n    }, function(n) {\n      return Boolean(n);\n    })[0];\n    return result || null;\n  },\n\n  /**\n   * @this {DocumentFragment}\n   */\n  // TODO(sorvell): `useNative` option relies on native querySelectorAll and\n  // misses distributed nodes, see\n  // https://github.com/webcomponents/shadydom/pull/210#issuecomment-361435503\n  querySelectorAll(selector, useNative) {\n    if (useNative) {\n      const o = Array.prototype.slice.call(querySelectorAll(this, selector));\n      const root = this.getRootNode();\n      return o.filter(e => e.getRootNode() == root);\n    }\n    return mutation.query(this, function(n) {\n      return utils.matchesSelector(n, selector);\n    });\n  }\n\n};\n\nlet slotMixin = {\n\n  /**\n   * @this {HTMLSlotElement}\n   */\n  assignedNodes(options) {\n    if (this.localName === 'slot') {\n      mutation.renderRootNode(this);\n      const nodeData = shadyDataForNode(this);\n      return nodeData ?\n        ((options && options.flatten ? nodeData.flattenedNodes :\n          nodeData.assignedNodes) || []) :\n        [];\n    }\n  }\n\n};\n\nlet elementMixin = utils.extendAll({\n\n  /**\n   * @this {HTMLElement}\n   */\n  setAttribute(name, value) {\n    mutation.setAttribute(this, name, value);\n  },\n\n  /**\n   * @this {HTMLElement}\n   */\n  removeAttribute(name) {\n    mutation.removeAttribute(this, name);\n  },\n\n  /**\n   * @this {HTMLElement}\n   */\n  attachShadow(options) {\n    return attachShadow(this, options);\n  },\n\n  /**\n   * @this {HTMLElement}\n   */\n  get slot() {\n    return this.getAttribute('slot');\n  },\n\n  /**\n   * @this {HTMLElement}\n   */\n  set slot(value) {\n    mutation.setAttribute(this, 'slot', value);\n  },\n\n  /**\n   * @this {HTMLElement}\n   */\n  get assignedSlot() {\n    return getAssignedSlot(this);\n  }\n\n}, fragmentMixin, slotMixin);\n\nObject.defineProperties(elementMixin, ShadowRootAccessor);\n\nlet documentMixin = utils.extendAll({\n  /**\n   * @this {Document}\n   */\n  importNode(node, deep) {\n    return mutation.importNode(node, deep);\n  },\n\n  /**\n   * @this {Document}\n   */\n  getElementById(id) {\n    let result = mutation.query(this, function(n) {\n      return n.id == id;\n    }, function(n) {\n      return Boolean(n);\n    })[0];\n    return result || null;\n  }\n\n}, fragmentMixin);\n\nObject.defineProperties(documentMixin, {\n  '_activeElement': ActiveElementAccessor.activeElement\n});\n\nlet nativeBlur = HTMLElement.prototype.blur;\n\nlet htmlElementMixin = utils.extendAll({\n  /**\n   * @this {HTMLElement}\n   */\n  blur() {\n    const nodeData = shadyDataForNode(this);\n    let root = nodeData && nodeData.root;\n    let shadowActive = root && root.activeElement;\n    if (shadowActive) {\n      shadowActive.blur();\n    } else {\n      nativeBlur.call(this);\n    }\n  }\n});\n\nconst shadowRootMixin = {\n  addEventListener(type, fn, optionsOrCapture) {\n    if (typeof optionsOrCapture !== 'object') {\n      optionsOrCapture = {\n        capture: Boolean(optionsOrCapture)\n      }\n    }\n    optionsOrCapture.__shadyTarget = this;\n    this.host.addEventListener(type, fn, optionsOrCapture);\n  },\n\n  removeEventListener(type, fn, optionsOrCapture) {\n    if (typeof optionsOrCapture !== 'object') {\n      optionsOrCapture = {\n        capture: Boolean(optionsOrCapture)\n      }\n    }\n    optionsOrCapture.__shadyTarget = this;\n    this.host.removeEventListener(type, fn, optionsOrCapture);\n  },\n\n  getElementById(id) {\n    let result = mutation.query(this, function(n) {\n      return n.id == id;\n    }, function(n) {\n      return Boolean(n);\n    })[0];\n    return result || null;\n  }\n}\n\nfunction patchBuiltin(proto, obj) {\n  let n$ = Object.getOwnPropertyNames(obj);\n  for (let i=0; i < n$.length; i++) {\n    let n = n$[i];\n    let d = Object.getOwnPropertyDescriptor(obj, n);\n    // NOTE: we prefer writing directly here because some browsers\n    // have descriptors that are writable but not configurable (e.g.\n    // `appendChild` on older browsers)\n    if (d.value) {\n      proto[n] = d.value;\n    } else {\n      Object.defineProperty(proto, n, d);\n    }\n  }\n}\n\n// Apply patches to builtins (e.g. Element.prototype). Some of these patches\n// can be done unconditionally (mostly methods like\n// `Element.prototype.appendChild`) and some can only be done when the browser\n// has proper descriptors on the builtin prototype\n// (e.g. `Element.prototype.firstChild`)`. When descriptors are not available,\n// elements are individually patched when needed (see e.g.\n// `patchInside/OutsideElementAccessors` in `patch-accessors.js`).\nexport function patchBuiltins() {\n  let nativeHTMLElement =\n    (window['customElements'] && window['customElements']['nativeHTMLElement']) ||\n    HTMLElement;\n  // These patches can always be done, for all supported browsers.\n  patchBuiltin(ShadyRoot.prototype, shadowRootMixin);\n  patchBuiltin(window.Node.prototype, nodeMixin);\n  patchBuiltin(window.Window.prototype, windowMixin);\n  patchBuiltin(window.Text.prototype, textMixin);\n  patchBuiltin(window.DocumentFragment.prototype, fragmentMixin);\n  patchBuiltin(window.Element.prototype, elementMixin);\n  patchBuiltin(window.Document.prototype, documentMixin);\n  if (window.HTMLSlotElement) {\n    patchBuiltin(window.HTMLSlotElement.prototype, slotMixin);\n  }\n  patchBuiltin(nativeHTMLElement.prototype, htmlElementMixin);\n  // These patches can *only* be done\n  // on browsers that have proper property descriptors on builtin prototypes.\n  // This includes: IE11, Edge, Chrome >= 4?; Safari >= 10, Firefox\n  // On older browsers (Chrome <= 4?, Safari 9), a per element patching\n  // strategy is used for patching accessors.\n  if (utils.settings.hasDescriptors) {\n    patchAccessors(window.Node.prototype);\n    patchAccessors(window.Text.prototype);\n    patchAccessors(window.DocumentFragment.prototype);\n    patchAccessors(window.Element.prototype);\n    patchAccessors(nativeHTMLElement.prototype);\n    patchAccessors(window.Document.prototype);\n    if (window.HTMLSlotElement) {\n      patchAccessors(window.HTMLSlotElement.prototype);\n    }\n  }\n  patchShadowRootAccessors(ShadyRoot.prototype);\n}\n","/**\n@license\nCopyright (c) 2016 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 {patchInsideElementAccessors, patchOutsideElementAccessors} from './patch-accessors.js';\nimport {accessors} from './native-tree.js';\nimport {ensureShadyDataForNode, shadyDataForNode} from './shady-data.js';\n\nconst {childNodes} = accessors;\n\nexport function recordInsertBefore(node, container, ref_node) {\n  patchInsideElementAccessors(container);\n  const containerData = ensureShadyDataForNode(container);\n  if (containerData.firstChild !== undefined) {\n    containerData.childNodes = null;\n  }\n  // handle document fragments\n  if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n    let c$ = node.childNodes;\n    for (let i=0; i < c$.length; i++) {\n      linkNode(c$[i], container, ref_node);\n    }\n    // cleanup logical dom in doc fragment.\n    const nodeData = ensureShadyDataForNode(node);\n    let resetTo = (nodeData.firstChild !== undefined) ? null : undefined;\n    nodeData.firstChild = nodeData.lastChild = resetTo;\n    nodeData.childNodes = resetTo;\n  } else {\n    linkNode(node, container, ref_node);\n  }\n}\n\nfunction linkNode(node, container, ref_node) {\n  patchOutsideElementAccessors(node);\n  ref_node = ref_node || null;\n  const nodeData = ensureShadyDataForNode(node);\n  const containerData = ensureShadyDataForNode(container);\n  const ref_nodeData = ref_node ? ensureShadyDataForNode(ref_node) : null;\n  // update ref_node.previousSibling <-> node\n  nodeData.previousSibling = ref_node ? ref_nodeData.previousSibling :\n    container.lastChild;\n  let psd = shadyDataForNode(nodeData.previousSibling);\n  if (psd) {\n    psd.nextSibling = node;\n  }\n  // update node <-> ref_node\n  let nsd = shadyDataForNode(nodeData.nextSibling = ref_node);\n  if (nsd) {\n    nsd.previousSibling = node;\n  }\n  // update node <-> container\n  nodeData.parentNode = container;\n  if (ref_node) {\n    if (ref_node === containerData.firstChild) {\n      containerData.firstChild = node;\n    }\n  } else {\n    containerData.lastChild = node;\n    if (!containerData.firstChild) {\n      containerData.firstChild = node;\n    }\n  }\n  // remove caching of childNodes\n  containerData.childNodes = null;\n}\n\nexport function recordRemoveChild(node, container) {\n  const nodeData = ensureShadyDataForNode(node);\n  const containerData = ensureShadyDataForNode(container);\n  if (node === containerData.firstChild) {\n    containerData.firstChild = nodeData.nextSibling;\n  }\n  if (node === containerData.lastChild) {\n    containerData.lastChild = nodeData.previousSibling;\n  }\n  let p = nodeData.previousSibling;\n  let n = nodeData.nextSibling;\n  if (p) {\n    ensureShadyDataForNode(p).nextSibling = n;\n  }\n  if (n) {\n    ensureShadyDataForNode(n).previousSibling = p;\n  }\n  // When an element is removed, logical data is no longer tracked.\n  // Explicitly set `undefined` here to indicate this. This is disginguished\n  // from `null` which is set if info is null.\n  nodeData.parentNode = nodeData.previousSibling =\n  nodeData.nextSibling = undefined;\n  if (containerData.childNodes !== undefined) {\n    // remove caching of childNodes\n    containerData.childNodes = null;\n  }\n}\n\nexport let recordChildNodes = function(node, nodes) {\n  const nodeData = ensureShadyDataForNode(node);\n  if (nodeData.firstChild === undefined) {\n    const c$ = nodes || childNodes(node);\n    nodeData.firstChild = c$[0] || null;\n    nodeData.lastChild = c$[c$.length-1] || null;\n    patchInsideElementAccessors(node);\n    for (let i=0; i<c$.length; i++) {\n      const n = c$[i];\n      const sd = ensureShadyDataForNode(n);\n      sd.parentNode = node;\n      sd.nextSibling = c$[i+1] || null;\n      sd.previousSibling = c$[i-1] || null;\n      patchOutsideElementAccessors(n);\n    }\n  }\n}","/**\n@license\nCopyright (c) 2016 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 * as utils from './utils.js';\nimport * as logicalTree from './logical-tree.js';\nimport * as nativeMethods from './native-methods.js';\nimport {accessors} from './native-tree.js';\nimport {ensureShadyDataForNode, shadyDataForNode} from './shady-data.js';\n\nconst {parentNode} = accessors;\n\n// Patched `insertBefore`. Note that all mutations that add nodes are routed\n// here. When a <slot> is added or a node is added to a host with a shadowRoot\n// with a slot, a standard dom `insert` call is aborted and `_asyncRender`\n// is called on the relevant shadowRoot. In all other cases, a standard dom\n// `insert` can be made, but the location and ref_node may need to be changed.\n/**\n * @param {Node} parent\n * @param {Node} node\n * @param {Node=} ref_node\n */\nexport function insertBefore(parent, node, ref_node) {\n  if (node === parent) {\n    throw Error(`Failed to execute 'appendChild' on 'Node': The new child element contains the parent.`);\n  }\n  if (ref_node) {\n    const refData = shadyDataForNode(ref_node);\n    const p = refData && refData.parentNode;\n    if ((p !== undefined && p !== parent) ||\n      (p === undefined && parentNode(ref_node) !== parent)) {\n      throw Error(`Failed to execute 'insertBefore' on 'Node': The node ` +\n       `before which the new node is to be inserted is not a child of this node.`);\n    }\n  }\n  if (ref_node === node) {\n    return node;\n  }\n  // remove from existing location\n  if (node.parentNode) {\n    // NOTE: avoid node.removeChild as this *can* trigger another patched\n    // method (e.g. custom elements) and we want only the shady method to run.\n    removeChild(node.parentNode, node);\n  }\n  // add to new parent\n  let preventNativeInsert;\n  let ownerRoot;\n  let slotsAdded;\n  if (!node['__noInsertionPoint']) {\n    ownerRoot = utils.ownerShadyRootForNode(parent);\n    slotsAdded = ownerRoot && findContainedSlots(node);\n    if (slotsAdded) {\n      ownerRoot._addSlots(slotsAdded);\n    }\n  }\n  // if a slot is added, must render containing root.\n  if (parent.localName === 'slot' || slotsAdded) {\n    ownerRoot = ownerRoot || utils.ownerShadyRootForNode(parent);\n    if (ownerRoot) {\n      ownerRoot._asyncRender();\n    }\n  }\n  if (utils.isTrackingLogicalChildNodes(parent)) {\n    logicalTree.recordInsertBefore(node, parent, ref_node);\n    // when inserting into a host with a shadowRoot with slot, use\n    // `shadowRoot._asyncRender()` via `attach-shadow` module\n    const parentData = shadyDataForNode(parent);\n    if (hasShadowRootWithSlot(parent)) {\n      parentData.root._asyncRender();\n      preventNativeInsert = true;\n    // when inserting into a host with shadowRoot with NO slot, do nothing\n    // as the node should not be added to composed dome anywhere.\n    } else if (parentData.root) {\n      preventNativeInsert = true;\n    }\n  }\n  if (!preventNativeInsert) {\n    // if adding to a shadyRoot, add to host instead\n    let container = utils.isShadyRoot(parent) ?\n      /** @type {ShadowRoot} */(parent).host : parent;\n    // if ref_node, get the ref_node that's actually in composed dom.\n    if (ref_node) {\n      ref_node = firstComposedNode(ref_node);\n      nativeMethods.insertBefore.call(container, node, ref_node);\n    } else {\n      nativeMethods.appendChild.call(container, node);\n    }\n  }\n  scheduleObserver(parent, node);\n  return node;\n}\n\nfunction findContainedSlots(node) {\n  let slots;\n  if (node.localName === 'slot') {\n    slots = [node];\n  } else if (node.querySelectorAll) {\n    slots = node.querySelectorAll('slot');\n  }\n  if (slots && slots.length) {\n    return slots;\n  }\n}\n\n/**\n * Patched `removeChild`. Note that all dom \"removals\" are routed here.\n * Removes the given `node` from the element's `children`.\n * This method also performs dom composition.\n * @param {Node} parent\n * @param {Node} node\n*/\nexport function removeChild(parent, node) {\n  if (node.parentNode !== parent) {\n    throw Error('The node to be removed is not a child of this node: ' +\n      node);\n  }\n  let preventNativeRemove;\n  let ownerRoot = utils.ownerShadyRootForNode(node);\n  let removingInsertionPoint;\n  const parentData = shadyDataForNode(parent);\n  if (utils.isTrackingLogicalChildNodes(parent)) {\n    logicalTree.recordRemoveChild(node, parent);\n    if (hasShadowRootWithSlot(parent)) {\n      parentData.root._asyncRender();\n      preventNativeRemove = true;\n    }\n  }\n  removeOwnerShadyRoot(node);\n  // if removing slot, must render containing root\n  if (ownerRoot) {\n    let changeSlotContent = parent && parent.localName === 'slot';\n    if (changeSlotContent) {\n      preventNativeRemove = true;\n    }\n    removingInsertionPoint = ownerRoot._removeContainedSlots(node);\n    if (removingInsertionPoint || changeSlotContent) {\n      ownerRoot._asyncRender();\n    }\n  }\n  if (!preventNativeRemove) {\n    // if removing from a shadyRoot, remove form host instead\n    let container = utils.isShadyRoot(parent) ?\n      /** @type {ShadowRoot} */(parent).host :\n      parent;\n    // not guaranteed to physically be in container; e.g.\n    // (1) if parent has a shadyRoot, element may or may not at distributed\n    // location (could be undistributed)\n    // (2) if parent is a slot, element may not ben in composed dom\n    if (!(parentData.root || node.localName === 'slot') ||\n      (container === parentNode(node))) {\n      nativeMethods.removeChild.call(container, node);\n    }\n  }\n  scheduleObserver(parent, null, node);\n  return node;\n}\n\nfunction removeOwnerShadyRoot(node) {\n  // optimization: only reset the tree if node is actually in a root\n  if (hasCachedOwnerRoot(node)) {\n    let c$ = node.childNodes;\n    for (let i=0, l=c$.length, n; (i<l) && (n=c$[i]); i++) {\n      removeOwnerShadyRoot(n);\n    }\n  }\n  const nodeData = shadyDataForNode(node);\n  if (nodeData) {\n    nodeData.ownerShadyRoot = undefined;\n  }\n}\n\nfunction hasCachedOwnerRoot(node) {\n  const nodeData = shadyDataForNode(node);\n  return Boolean(nodeData && nodeData.ownerShadyRoot !== undefined);\n}\n\n/**\n * Finds the first flattened node that is composed in the node's parent.\n * If the given node is a slot, then the first flattened node is returned\n * if it exists, otherwise advance to the node's nextSibling.\n * @param {Node} node within which to find first composed node\n * @returns {Node} first composed node\n */\nfunction firstComposedNode(node) {\n  let composed = node;\n  if (node && node.localName === 'slot') {\n    const nodeData = shadyDataForNode(node);\n    const flattened = nodeData && nodeData.flattenedNodes;\n    composed = flattened && flattened.length ? flattened[0] :\n      firstComposedNode(node.nextSibling);\n  }\n  return composed;\n}\n\nfunction hasShadowRootWithSlot(node) {\n  const nodeData = shadyDataForNode(node);\n  let root = nodeData && nodeData.root;\n  return (root && root._hasInsertionPoint());\n}\n\n/**\n * Should be called whenever an attribute changes. If the `slot` attribute\n * changes, provokes rendering if necessary. If a `<slot>` element's `name`\n * attribute changes, updates the root's slot map and renders.\n * @param {Node} node\n * @param {string} name\n */\nfunction distributeAttributeChange(node, name) {\n  if (name === 'slot') {\n    const parent = node.parentNode;\n    if (hasShadowRootWithSlot(parent)) {\n      shadyDataForNode(parent).root._asyncRender();\n    }\n  } else if (node.localName === 'slot' && name === 'name') {\n    let root = utils.ownerShadyRootForNode(node);\n    if (root) {\n      root._updateSlotName(node);\n      root._asyncRender();\n    }\n  }\n}\n\n/**\n * @param {Node} node\n * @param {Node=} addedNode\n * @param {Node=} removedNode\n */\nfunction scheduleObserver(node, addedNode, removedNode) {\n  const nodeData = shadyDataForNode(node);\n  const observer = nodeData && nodeData.observer;\n  if (observer) {\n    if (addedNode) {\n      observer.addedNodes.push(addedNode);\n    }\n    if (removedNode) {\n      observer.removedNodes.push(removedNode);\n    }\n    observer.schedule();\n  }\n}\n\n/**\n * @param {Node} node\n * @param {Object=} options\n */\nexport function getRootNode(node, options) { // eslint-disable-line no-unused-vars\n  if (!node || !node.nodeType) {\n    return;\n  }\n  const nodeData = ensureShadyDataForNode(node);\n  let root = nodeData.ownerShadyRoot;\n  if (root === undefined) {\n    if (utils.isShadyRoot(node)) {\n      root = node;\n      nodeData.ownerShadyRoot = root;\n    } else {\n      let parent = node.parentNode;\n      root = parent ? getRootNode(parent) : node;\n      // memo-ize result for performance but only memo-ize\n      // result if node is in the document. This avoids a problem where a root\n      // can be cached while an element is inside a fragment.\n      // If this happens and we cache the result, the value can become stale\n      // because for perf we avoid processing the subtree of added fragments.\n      if (nativeMethods.contains.call(document.documentElement, node)) {\n        nodeData.ownerShadyRoot = root;\n      }\n    }\n\n  }\n  return root;\n}\n\n// NOTE: `query` is used primarily for ShadyDOM's querySelector impl,\n// but it's also generally useful to recurse through the element tree\n// and is used by Polymer's styling system.\n/**\n * @param {Node} node\n * @param {Function} matcher\n * @param {Function=} halter\n */\nexport function query(node, matcher, halter) {\n  let list = [];\n  queryElements(node.childNodes, matcher,\n    halter, list);\n  return list;\n}\n\nfunction queryElements(elements, matcher, halter, list) {\n  for (let i=0, l=elements.length, c; (i<l) && (c=elements[i]); i++) {\n    if (c.nodeType === Node.ELEMENT_NODE &&\n        queryElement(c, matcher, halter, list)) {\n      return true;\n    }\n  }\n}\n\nfunction queryElement(node, matcher, halter, list) {\n  let result = matcher(node);\n  if (result) {\n    list.push(node);\n  }\n  if (halter && halter(result)) {\n    return result;\n  }\n  queryElements(node.childNodes, matcher,\n    halter, list);\n}\n\nexport function renderRootNode(element) {\n  var root = element.getRootNode();\n  if (utils.isShadyRoot(root)) {\n    root._render();\n  }\n}\n\nlet scopingShim = null;\n\nexport function setAttribute(node, attr, value) {\n  if (!scopingShim) {\n    scopingShim = window['ShadyCSS'] && window['ShadyCSS']['ScopingShim'];\n  }\n  if (scopingShim && attr === 'class') {\n    scopingShim['setElementClass'](node, value);\n  } else {\n    nativeMethods.setAttribute.call(node, attr, value);\n    distributeAttributeChange(node, attr);\n  }\n}\n\nexport function removeAttribute(node, attr) {\n  nativeMethods.removeAttribute.call(node, attr);\n  distributeAttributeChange(node, attr);\n}\n\nexport function cloneNode(node, deep) {\n  if (node.localName == 'template') {\n    return nativeMethods.cloneNode.call(node, deep);\n  } else {\n    let n = nativeMethods.cloneNode.call(node, false);\n    if (deep) {\n      let c$ = node.childNodes;\n      for (let i=0, nc; i < c$.length; i++) {\n        nc = c$[i].cloneNode(true);\n        n.appendChild(nc);\n      }\n    }\n    return n;\n  }\n}\n\n// note: Though not technically correct, we fast path `importNode`\n// when called on a node not owned by the main document.\n// This allows, for example, elements that cannot\n// contain custom elements and are therefore not likely to contain shadowRoots\n// to cloned natively. This is a fairly significant performance win.\nexport function importNode(node, deep) {\n  if (node.ownerDocument !== document) {\n    return nativeMethods.importNode.call(document, node, deep);\n  }\n  let n = nativeMethods.importNode.call(document, node, false);\n  if (deep) {\n    let c$ = node.childNodes;\n    for (let i=0, nc; i < c$.length; i++) {\n      nc = importNode(c$[i], true);\n      n.appendChild(nc);\n    }\n  }\n  return n;\n}",null,"/**\n@license\nCopyright (c) 2016 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 * as utils from './utils.js';\nimport * as nativeMethods from './native-methods.js';\nimport {shadyDataForNode} from './shady-data.js';\n\n/*\nMake this name unique so it is unlikely to conflict with properties on objects passed to `addEventListener`\nhttps://github.com/webcomponents/shadydom/issues/173\n*/\nconst /** string */ eventWrappersName = `__eventWrappers${Date.now()}`;\n\n// https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937\nlet alwaysComposed = {\n  'blur': true,\n  'focus': true,\n  'focusin': true,\n  'focusout': true,\n  'click': true,\n  'dblclick': true,\n  'mousedown': true,\n  'mouseenter': true,\n  'mouseleave': true,\n  'mousemove': true,\n  'mouseout': true,\n  'mouseover': true,\n  'mouseup': true,\n  'wheel': true,\n  'beforeinput': true,\n  'input': true,\n  'keydown': true,\n  'keyup': true,\n  'compositionstart': true,\n  'compositionupdate': true,\n  'compositionend': true,\n  'touchstart': true,\n  'touchend': true,\n  'touchmove': true,\n  'touchcancel': true,\n  'pointerover': true,\n  'pointerenter': true,\n  'pointerdown': true,\n  'pointermove': true,\n  'pointerup': true,\n  'pointercancel': true,\n  'pointerout': true,\n  'pointerleave': true,\n  'gotpointercapture': true,\n  'lostpointercapture': true,\n  'dragstart': true,\n  'drag': true,\n  'dragenter': true,\n  'dragleave': true,\n  'dragover': true,\n  'drop': true,\n  'dragend': true,\n  'DOMActivate': true,\n  'DOMFocusIn': true,\n  'DOMFocusOut': true,\n  'keypress': true\n};\n\nfunction pathComposer(startNode, composed) {\n  let composedPath = [];\n  let current = startNode;\n  let startRoot = startNode === window ? window : startNode.getRootNode();\n  while (current) {\n    composedPath.push(current);\n    if (current.assignedSlot) {\n      current = current.assignedSlot;\n    } else if (current.nodeType === Node.DOCUMENT_FRAGMENT_NODE && current.host && (composed || current !== startRoot)) {\n      current = current.host;\n    } else {\n      current = current.parentNode;\n    }\n  }\n  // event composedPath includes window when startNode's ownerRoot is document\n  if (composedPath[composedPath.length - 1] === document) {\n    composedPath.push(window);\n  }\n  return composedPath;\n}\n\nfunction retarget(refNode, path) {\n  if (!utils.isShadyRoot) {\n    return refNode;\n  }\n  // If ANCESTOR's root is not a shadow root or ANCESTOR's root is BASE's\n  // shadow-including inclusive ancestor, return ANCESTOR.\n  let refNodePath = pathComposer(refNode, true);\n  let p$ = path;\n  for (let i=0, ancestor, lastRoot, root, rootIdx; i < p$.length; i++) {\n    ancestor = p$[i];\n    root = ancestor === window ? window : ancestor.getRootNode();\n    if (root !== lastRoot) {\n      rootIdx = refNodePath.indexOf(root);\n      lastRoot = root;\n    }\n    if (!utils.isShadyRoot(root) || rootIdx > -1) {\n      return ancestor;\n    }\n  }\n}\n\nlet eventMixin = {\n\n  /**\n   * @this {Event}\n   */\n  get composed() {\n    // isTrusted may not exist in this browser, so just check if isTrusted is explicitly false\n    if (this.isTrusted !== false && this.__composed === undefined) {\n      this.__composed = alwaysComposed[this.type];\n    }\n    return this.__composed || false;\n  },\n\n  /**\n   * @this {Event}\n   */\n  composedPath() {\n    if (!this.__composedPath) {\n      this.__composedPath = pathComposer(this['__target'], this.composed);\n    }\n    return this.__composedPath;\n  },\n\n  /**\n   * @this {Event}\n   */\n  get target() {\n    return retarget(this.currentTarget, this.composedPath());\n  },\n\n  // http://w3c.github.io/webcomponents/spec/shadow/#event-relatedtarget-retargeting\n  /**\n   * @this {Event}\n   */\n  get relatedTarget() {\n    if (!this.__relatedTarget) {\n      return null;\n    }\n    if (!this.__relatedTargetComposedPath) {\n      this.__relatedTargetComposedPath = pathComposer(this.__relatedTarget, true);\n    }\n    // find the deepest node in relatedTarget composed path that is in the same root with the currentTarget\n    return retarget(this.currentTarget, this.__relatedTargetComposedPath);\n  },\n  /**\n   * @this {Event}\n   */\n  stopPropagation() {\n    Event.prototype.stopPropagation.call(this);\n    this.__propagationStopped = true;\n  },\n  /**\n   * @this {Event}\n   */\n  stopImmediatePropagation() {\n    Event.prototype.stopImmediatePropagation.call(this);\n    this.__immediatePropagationStopped = true;\n    this.__propagationStopped = true;\n  }\n\n};\n\nfunction mixinComposedFlag(Base) {\n  // NOTE: avoiding use of `class` here so that transpiled output does not\n  // try to do `Base.call` with a dom construtor.\n  let klazz = function(type, options) {\n    let event = new Base(type, options);\n    event.__composed = options && Boolean(options['composed']);\n    return event;\n  }\n  // put constructor properties on subclass\n  utils.mixin(klazz, Base);\n  klazz.prototype = Base.prototype;\n  return klazz;\n}\n\nlet nonBubblingEventsToRetarget = {\n  'focus': true,\n  'blur': true\n};\n\n\n/**\n * Check if the event has been retargeted by comparing original `target`, and calculated `target`\n * @param {Event} event\n * @return {boolean} True if the original target and calculated target are the same\n */\nfunction hasRetargeted(event) {\n  return event['__target'] !== event.target || event.__relatedTarget !== event.relatedTarget;\n}\n\n/**\n *\n * @param {Event} event\n * @param {Node} node\n * @param {string} phase\n */\nfunction fireHandlers(event, node, phase) {\n  let hs = node.__handlers && node.__handlers[event.type] &&\n    node.__handlers[event.type][phase];\n  if (hs) {\n    for (let i = 0, fn; (fn = hs[i]); i++) {\n      if (hasRetargeted(event) && event.target === event.relatedTarget) {\n        return;\n      }\n      fn.call(node, event);\n      if (event.__immediatePropagationStopped) {\n        return;\n      }\n    }\n  }\n}\n\nfunction retargetNonBubblingEvent(e) {\n  let path = e.composedPath();\n  let node;\n  // override `currentTarget` to let patched `target` calculate correctly\n  Object.defineProperty(e, 'currentTarget', {\n    get: function() {\n      return node;\n    },\n    configurable: true\n  });\n  for (let i = path.length - 1; i >= 0; i--) {\n    node = path[i];\n    // capture phase fires all capture handlers\n    fireHandlers(e, node, 'capture');\n    if (e.__propagationStopped) {\n      return;\n    }\n  }\n\n  // set the event phase to `AT_TARGET` as in spec\n  Object.defineProperty(e, 'eventPhase', {get() { return Event.AT_TARGET }});\n\n  // the event only needs to be fired when owner roots change when iterating the event path\n  // keep track of the last seen owner root\n  let lastFiredRoot;\n  for (let i = 0; i < path.length; i++) {\n    node = path[i];\n    const nodeData = shadyDataForNode(node);\n    const root = nodeData && nodeData.root;\n    if (i === 0 || (root && root === lastFiredRoot)) {\n      fireHandlers(e, node, 'bubble');\n      // don't bother with window, it doesn't have `getRootNode` and will be last in the path anyway\n      if (node !== window) {\n        lastFiredRoot = node.getRootNode();\n      }\n      if (e.__propagationStopped) {\n        return;\n      }\n    }\n  }\n}\n\nfunction listenerSettingsEqual(savedListener, node, type, capture, once, passive) {\n  let {\n    node: savedNode,\n    type: savedType,\n    capture: savedCapture,\n    once: savedOnce,\n    passive: savedPassive\n  } = savedListener;\n  return node === savedNode &&\n    type === savedType &&\n    capture === savedCapture &&\n    once === savedOnce &&\n    passive === savedPassive;\n}\n\nexport function findListener(wrappers, node, type, capture, once, passive) {\n  for (let i = 0; i < wrappers.length; i++) {\n    if (listenerSettingsEqual(wrappers[i], node, type, capture, once, passive)) {\n      return i;\n    }\n  }\n  return -1;\n}\n\n/**\n * Firefox can throw on accessing eventWrappers inside of `removeEventListener` during a selenium run\n * Try/Catch accessing eventWrappers to work around\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1353074\n */\nfunction getEventWrappers(eventLike) {\n  let wrappers = null;\n  try {\n    wrappers = eventLike[eventWrappersName];\n  } catch (e) {} // eslint-disable-line no-empty\n  return wrappers;\n}\n\n/**\n * @this {Event}\n */\nexport function addEventListener(type, fnOrObj, optionsOrCapture) {\n  if (!fnOrObj) {\n    return;\n  }\n\n  const handlerType = typeof fnOrObj;\n\n  // bail if `fnOrObj` is not a function, not an object\n  if (handlerType !== 'function' && handlerType !== 'object') {\n    return;\n  }\n\n  // bail if `fnOrObj` is an object without a `handleEvent` method\n  if (handlerType === 'object' && (!fnOrObj.handleEvent || typeof fnOrObj.handleEvent !== 'function')) {\n    return;\n  }\n\n  // The callback `fn` might be used for multiple nodes/events. Since we generate\n  // a wrapper function, we need to keep track of it when we remove the listener.\n  // It's more efficient to store the node/type/options information as Array in\n  // `fn` itself rather than the node (we assume that the same callback is used\n  // for few nodes at most, whereas a node will likely have many event listeners).\n  // NOTE(valdrin) invoking external functions is costly, inline has better perf.\n  let capture, once, passive;\n  if (optionsOrCapture && typeof optionsOrCapture === 'object') {\n    capture = Boolean(optionsOrCapture.capture);\n    once = Boolean(optionsOrCapture.once);\n    passive = Boolean(optionsOrCapture.passive);\n  } else {\n    capture = Boolean(optionsOrCapture);\n    once = false;\n    passive = false;\n  }\n  // hack to let ShadyRoots have event listeners\n  // event listener will be on host, but `currentTarget`\n  // will be set to shadyroot for event listener\n  let target = (optionsOrCapture && optionsOrCapture.__shadyTarget) || this;\n\n  let wrappers = fnOrObj[eventWrappersName];\n  if (wrappers) {\n    // Stop if the wrapper function has already been created.\n    if (findListener(wrappers, target, type, capture, once, passive) > -1) {\n      return;\n    }\n  } else {\n    fnOrObj[eventWrappersName] = [];\n  }\n\n  /**\n   * @this {HTMLElement}\n   * @param {Event} e\n   */\n  const wrapperFn = function(e) {\n    // Support `once` option.\n    if (once) {\n      this.removeEventListener(type, fnOrObj, optionsOrCapture);\n    }\n    if (!e['__target']) {\n      patchEvent(e);\n    }\n    let lastCurrentTargetDesc;\n    if (target !== this) {\n      // replace `currentTarget` to make `target` and `relatedTarget` correct for inside the shadowroot\n      lastCurrentTargetDesc = Object.getOwnPropertyDescriptor(e, 'currentTarget');\n      Object.defineProperty(e, 'currentTarget', {get() { return target }, configurable: true});\n    }\n    // There are two critera that should stop events from firing on this node\n    // 1. the event is not composed and the current node is not in the same root as the target\n    // 2. when bubbling, if after retargeting, relatedTarget and target point to the same node\n    if (e.composed || e.composedPath().indexOf(target) > -1) {\n      if (hasRetargeted(e) && e.target === e.relatedTarget) {\n        if (e.eventPhase === Event.BUBBLING_PHASE) {\n          e.stopImmediatePropagation();\n        }\n        return;\n      }\n      // prevent non-bubbling events from triggering bubbling handlers on shadowroot, but only if not in capture phase\n      if (e.eventPhase !== Event.CAPTURING_PHASE && !e.bubbles && e.target !== target && !(target instanceof Window)) {\n        return;\n      }\n      let ret = handlerType === 'function' ?\n        fnOrObj.call(target, e) :\n        (fnOrObj.handleEvent && fnOrObj.handleEvent(e));\n      if (target !== this) {\n        // replace the \"correct\" `currentTarget`\n        if (lastCurrentTargetDesc) {\n          Object.defineProperty(e, 'currentTarget', lastCurrentTargetDesc);\n          lastCurrentTargetDesc = null;\n        } else {\n          delete e['currentTarget'];\n        }\n      }\n      return ret;\n    }\n  };\n  // Store the wrapper information.\n  fnOrObj[eventWrappersName].push({\n    // note: use target here which is either a shadowRoot\n    // (when the host element is proxy'ing the event) or this element\n    node: target,\n    type: type,\n    capture: capture,\n    once: once,\n    passive: passive,\n    wrapperFn: wrapperFn\n  });\n\n  if (nonBubblingEventsToRetarget[type]) {\n    this.__handlers = this.__handlers || {};\n    this.__handlers[type] = this.__handlers[type] ||\n      {'capture': [], 'bubble': []};\n    this.__handlers[type][capture ? 'capture' : 'bubble'].push(wrapperFn);\n  } else {\n    let ael = this instanceof Window ? nativeMethods.windowAddEventListener :\n      nativeMethods.addEventListener;\n    ael.call(this, type, wrapperFn, optionsOrCapture);\n  }\n}\n\n/**\n * @this {Event}\n */\nexport function removeEventListener(type, fnOrObj, optionsOrCapture) {\n  if (!fnOrObj) {\n    return;\n  }\n\n  // NOTE(valdrin) invoking external functions is costly, inline has better perf.\n  let capture, once, passive;\n  if (optionsOrCapture && typeof optionsOrCapture === 'object') {\n    capture = Boolean(optionsOrCapture.capture);\n    once = Boolean(optionsOrCapture.once);\n    passive = Boolean(optionsOrCapture.passive);\n  } else {\n    capture = Boolean(optionsOrCapture);\n    once = false;\n    passive = false;\n  }\n  let target = (optionsOrCapture && optionsOrCapture.__shadyTarget) || this;\n  // Search the wrapped function.\n  let wrapperFn = undefined;\n  let wrappers = getEventWrappers(fnOrObj);\n  if (wrappers) {\n    let idx = findListener(wrappers, target, type, capture, once, passive);\n    if (idx > -1) {\n      wrapperFn = wrappers.splice(idx, 1)[0].wrapperFn;\n      // Cleanup.\n      if (!wrappers.length) {\n        fnOrObj[eventWrappersName] = undefined;\n      }\n    }\n  }\n  let rel = this instanceof Window ? nativeMethods.windowRemoveEventListener :\n    nativeMethods.removeEventListener;\n  rel.call(this, type, wrapperFn || fnOrObj, optionsOrCapture);\n  if (wrapperFn && nonBubblingEventsToRetarget[type] &&\n      this.__handlers && this.__handlers[type]) {\n    const arr = this.__handlers[type][capture ? 'capture' : 'bubble'];\n    const idx = arr.indexOf(wrapperFn);\n    if (idx > -1) {\n      arr.splice(idx, 1);\n    }\n  }\n}\n\nfunction activateFocusEventOverrides() {\n  for (let ev in nonBubblingEventsToRetarget) {\n    window.addEventListener(ev, function(e) {\n      if (!e['__target']) {\n        patchEvent(e);\n        retargetNonBubblingEvent(e);\n      }\n    }, true);\n  }\n}\n\nfunction patchEvent(event) {\n  event['__target'] = event.target;\n  event.__relatedTarget = event.relatedTarget;\n  // patch event prototype if we can\n  if (utils.settings.hasDescriptors) {\n    utils.patchPrototype(event, eventMixin);\n  // and fallback to patching instance\n  } else {\n    utils.extend(event, eventMixin);\n  }\n}\n\nlet PatchedEvent = mixinComposedFlag(window.Event);\nlet PatchedCustomEvent = mixinComposedFlag(window.CustomEvent);\nlet PatchedMouseEvent = mixinComposedFlag(window.MouseEvent);\n\nexport function patchEvents() {\n  window.Event = PatchedEvent;\n  window.CustomEvent = PatchedCustomEvent;\n  window.MouseEvent = PatchedMouseEvent;\n  activateFocusEventOverrides();\n}\n","/**\n@license\nCopyright (c) 2016 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 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 */\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\nfunction equals(currentValue, previousValue) {\n  return currentValue === previousValue;\n}\n\nexport function calculateSplices(current, previous) {\n  return calcSplices(current, 0, current.length, previous, 0,\n                          previous.length);\n}\n\n","/**\n@license\nCopyright (c) 2016 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 * Patches elements that interacts with ShadyDOM\n * such that tree traversal and mutation apis act like they would under\n * ShadowDOM.\n *\n * This import enables seemless interaction with ShadyDOM powered\n * custom elements, enabling better interoperation with 3rd party code,\n * libraries, and frameworks that use DOM tree manipulation apis.\n */\n\nimport * as utils from './utils.js';\nimport {flush, enqueue} from './flush.js';\nimport {observeChildren, unobserveChildren, filterMutations} from './observe-changes.js';\nimport * as nativeMethods from './native-methods.js';\nimport {accessors as nativeTree} from './native-tree.js';\nimport {patchBuiltins} from './patch-builtins.js';\nimport {patchInsideElementAccessors, patchOutsideElementAccessors} from './patch-accessors.js';\nimport {patchEvents} from './patch-events.js';\nimport {ShadyRoot} from './attach-shadow.js';\n\nif (utils.settings.inUse) {\n  let ShadyDOM = {\n    // TODO(sorvell): remove when Polymer does not depend on this.\n    'inUse': utils.settings.inUse,\n    // NOTE: old browsers without prototype accessors (very old Chrome\n    // and Safari) need manually patched accessors to properly set\n    // `innerHTML` and `textContent` when an element is:\n    // (1) inside a shadowRoot\n    // (2) does not have special (slot) children itself\n    // (3) and setting the property needs to provoke distribution (because\n    // a nested slot is added/removed)\n    'patch': (node) => {\n      patchInsideElementAccessors(node);\n      patchOutsideElementAccessors(node);\n      return node;\n    },\n    'isShadyRoot': utils.isShadyRoot,\n    'enqueue': enqueue,\n    'flush': flush,\n    'settings': utils.settings,\n    'filterMutations': filterMutations,\n    'observeChildren': observeChildren,\n    'unobserveChildren': unobserveChildren,\n    'nativeMethods': nativeMethods,\n    'nativeTree': nativeTree\n  };\n\n  window['ShadyDOM'] = ShadyDOM;\n\n  // Apply patches to events...\n  patchEvents();\n  // Apply patches to builtins (e.g. Element.prototype) where applicable.\n  patchBuiltins();\n\n  window.ShadowRoot = ShadyRoot;\n}","const reservedTagList = new Set([\n  'annotation-xml',\n  'color-profile',\n  'font-face',\n  'font-face-src',\n  'font-face-uri',\n  'font-face-format',\n  'font-face-name',\n  'missing-glyph',\n]);\n\n/**\n * @param {string} localName\n * @returns {boolean}\n */\nexport function isValidCustomElementName(localName) {\n  const reserved = reservedTagList.has(localName);\n  const validForm = /^[a-z][.0-9_a-z]*-[\\-.0-9_a-z]*$/.test(localName);\n  return !reserved && validForm;\n}\n\n/**\n * @private\n * @param {!Node} node\n * @return {boolean}\n */\nexport function isConnected(node) {\n  // Use `Node#isConnected`, if defined.\n  const nativeValue = node.isConnected;\n  if (nativeValue !== undefined) {\n    return nativeValue;\n  }\n\n  /** @type {?Node|undefined} */\n  let current = node;\n  while (current && !(current.__CE_isImportDocument || current instanceof Document)) {\n    current = current.parentNode || (window.ShadowRoot && current instanceof ShadowRoot ? current.host : undefined);\n  }\n  return !!(current && (current.__CE_isImportDocument || current instanceof Document));\n}\n\n/**\n * @param {!Node} root\n * @param {!Node} start\n * @return {?Node}\n */\nfunction nextSiblingOrAncestorSibling(root, start) {\n  let node = start;\n  while (node && node !== root && !node.nextSibling) {\n    node = node.parentNode;\n  }\n  return (!node || node === root) ? null : node.nextSibling;\n}\n\n/**\n * @param {!Node} root\n * @param {!Node} start\n * @return {?Node}\n */\nfunction nextNode(root, start) {\n  return start.firstChild ? start.firstChild : nextSiblingOrAncestorSibling(root, start);\n}\n\n/**\n * @param {!Node} root\n * @param {!function(!Element)} callback\n * @param {!Set<Node>=} visitedImports\n */\nexport function walkDeepDescendantElements(root, callback, visitedImports = new Set()) {\n  let node = root;\n  while (node) {\n    if (node.nodeType === Node.ELEMENT_NODE) {\n      const element = /** @type {!Element} */(node);\n\n      callback(element);\n\n      const localName = element.localName;\n      if (localName === 'link' && element.getAttribute('rel') === 'import') {\n        // If this import (polyfilled or not) has it's root node available,\n        // walk it.\n        const importNode = /** @type {!Node} */ (element.import);\n        if (importNode instanceof Node && !visitedImports.has(importNode)) {\n          // Prevent multiple walks of the same import root.\n          visitedImports.add(importNode);\n\n          for (let child = importNode.firstChild; child; child = child.nextSibling) {\n            walkDeepDescendantElements(child, callback, visitedImports);\n          }\n        }\n\n        // Ignore descendants of import links to prevent attempting to walk the\n        // elements created by the HTML Imports polyfill that we just walked\n        // above.\n        node = nextSiblingOrAncestorSibling(root, element);\n        continue;\n      } else if (localName === 'template') {\n        // Ignore descendants of templates. There shouldn't be any descendants\n        // because they will be moved into `.content` during construction in\n        // browsers that support template but, in case they exist and are still\n        // waiting to be moved by a polyfill, they will be ignored.\n        node = nextSiblingOrAncestorSibling(root, element);\n        continue;\n      }\n\n      // Walk shadow roots.\n      const shadowRoot = element.__CE_shadowRoot;\n      if (shadowRoot) {\n        for (let child = shadowRoot.firstChild; child; child = child.nextSibling) {\n          walkDeepDescendantElements(child, callback, visitedImports);\n        }\n      }\n    }\n\n    node = nextNode(root, node);\n  }\n}\n\n/**\n * Used to suppress Closure's \"Modifying the prototype is only allowed if the\n * constructor is in the same scope\" warning without using\n * `@suppress {newCheckTypes, duplicate}` because `newCheckTypes` is too broad.\n *\n * @param {!Object} destination\n * @param {string} name\n * @param {*} value\n */\nexport function setPropertyUnchecked(destination, name, value) {\n  destination[name] = value;\n}\n","import * as Utilities from './Utilities.js';\nimport CEState from './CustomElementState.js';\n\nexport default class CustomElementInternals {\n  constructor() {\n    /** @type {!Map<string, !CustomElementDefinition>} */\n    this._localNameToDefinition = new Map();\n\n    /** @type {!Map<!Function, !CustomElementDefinition>} */\n    this._constructorToDefinition = new Map();\n\n    /** @type {!Array<!function(!Node)>} */\n    this._patches = [];\n\n    /** @type {boolean} */\n    this._hasPatches = false;\n  }\n\n  /**\n   * @param {string} localName\n   * @param {!CustomElementDefinition} definition\n   */\n  setDefinition(localName, definition) {\n    this._localNameToDefinition.set(localName, definition);\n    this._constructorToDefinition.set(definition.constructor, definition);\n  }\n\n  /**\n   * @param {string} localName\n   * @return {!CustomElementDefinition|undefined}\n   */\n  localNameToDefinition(localName) {\n    return this._localNameToDefinition.get(localName);\n  }\n\n  /**\n   * @param {!Function} constructor\n   * @return {!CustomElementDefinition|undefined}\n   */\n  constructorToDefinition(constructor) {\n    return this._constructorToDefinition.get(constructor);\n  }\n\n  /**\n   * @param {!function(!Node)} listener\n   */\n  addPatch(listener) {\n    this._hasPatches = true;\n    this._patches.push(listener);\n  }\n\n  /**\n   * @param {!Node} node\n   */\n  patchTree(node) {\n    if (!this._hasPatches) return;\n\n    Utilities.walkDeepDescendantElements(node, element => this.patch(element));\n  }\n\n  /**\n   * @param {!Node} node\n   */\n  patch(node) {\n    if (!this._hasPatches) return;\n\n    if (node.__CE_patched) return;\n    node.__CE_patched = true;\n\n    for (let i = 0; i < this._patches.length; i++) {\n      this._patches[i](node);\n    }\n  }\n\n  /**\n   * @param {!Node} root\n   */\n  connectTree(root) {\n    const elements = [];\n\n    Utilities.walkDeepDescendantElements(root, element => elements.push(element));\n\n    for (let i = 0; i < elements.length; i++) {\n      const element = elements[i];\n      if (element.__CE_state === CEState.custom) {\n        this.connectedCallback(element);\n      } else {\n        this.upgradeElement(element);\n      }\n    }\n  }\n\n  /**\n   * @param {!Node} root\n   */\n  disconnectTree(root) {\n    const elements = [];\n\n    Utilities.walkDeepDescendantElements(root, element => elements.push(element));\n\n    for (let i = 0; i < elements.length; i++) {\n      const element = elements[i];\n      if (element.__CE_state === CEState.custom) {\n        this.disconnectedCallback(element);\n      }\n    }\n  }\n\n  /**\n   * Upgrades all uncustomized custom elements at and below a root node for\n   * which there is a definition. When custom element reaction callbacks are\n   * assumed to be called synchronously (which, by the current DOM / HTML spec\n   * definitions, they are *not*), callbacks for both elements customized\n   * synchronously by the parser and elements being upgraded occur in the same\n   * relative order.\n   *\n   * NOTE: This function, when used to simulate the construction of a tree that\n   * is already created but not customized (i.e. by the parser), does *not*\n   * prevent the element from reading the 'final' (true) state of the tree. For\n   * example, the element, during truly synchronous parsing / construction would\n   * see that it contains no children as they have not yet been inserted.\n   * However, this function does not modify the tree, the element will\n   * (incorrectly) have children. Additionally, self-modification restrictions\n   * for custom element constructors imposed by the DOM spec are *not* enforced.\n   *\n   *\n   * The following nested list shows the steps extending down from the HTML\n   * spec's parsing section that cause elements to be synchronously created and\n   * upgraded:\n   *\n   * The \"in body\" insertion mode:\n   * https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody\n   * - Switch on token:\n   *   .. other cases ..\n   *   -> Any other start tag\n   *      - [Insert an HTML element](below) for the token.\n   *\n   * Insert an HTML element:\n   * https://html.spec.whatwg.org/multipage/syntax.html#insert-an-html-element\n   * - Insert a foreign element for the token in the HTML namespace:\n   *   https://html.spec.whatwg.org/multipage/syntax.html#insert-a-foreign-element\n   *   - Create an element for a token:\n   *     https://html.spec.whatwg.org/multipage/syntax.html#create-an-element-for-the-token\n   *     - Will execute script flag is true?\n   *       - (Element queue pushed to the custom element reactions stack.)\n   *     - Create an element:\n   *       https://dom.spec.whatwg.org/#concept-create-element\n   *       - Sync CE flag is true?\n   *         - Constructor called.\n   *         - Self-modification restrictions enforced.\n   *       - Sync CE flag is false?\n   *         - (Upgrade reaction enqueued.)\n   *     - Attributes appended to element.\n   *       (`attributeChangedCallback` reactions enqueued.)\n   *     - Will execute script flag is true?\n   *       - (Element queue popped from the custom element reactions stack.\n   *         Reactions in the popped stack are invoked.)\n   *   - (Element queue pushed to the custom element reactions stack.)\n   *   - Insert the element:\n   *     https://dom.spec.whatwg.org/#concept-node-insert\n   *     - Shadow-including descendants are connected. During parsing\n   *       construction, there are no shadow-*excluding* descendants.\n   *       However, the constructor may have validly attached a shadow\n   *       tree to itself and added descendants to that shadow tree.\n   *       (`connectedCallback` reactions enqueued.)\n   *   - (Element queue popped from the custom element reactions stack.\n   *     Reactions in the popped stack are invoked.)\n   *\n   * @param {!Node} root\n   * @param {{\n   *   visitedImports: (!Set<!Node>|undefined),\n   *   upgrade: (!function(!Element)|undefined),\n   * }=} options\n   */\n  patchAndUpgradeTree(root, options = {}) {\n    const visitedImports = options.visitedImports || new Set();\n    const upgrade = options.upgrade || (element => this.upgradeElement(element));\n\n    const elements = [];\n\n    const gatherElements = element => {\n      if (element.localName === 'link' && element.getAttribute('rel') === 'import') {\n        // The HTML Imports polyfill sets a descendant element of the link to\n        // the `import` property, specifically this is *not* a Document.\n        const importNode = /** @type {?Node} */ (element.import);\n\n        if (importNode instanceof Node) {\n          importNode.__CE_isImportDocument = true;\n          // Connected links are associated with the registry.\n          importNode.__CE_hasRegistry = true;\n        }\n\n        if (importNode && importNode.readyState === 'complete') {\n          importNode.__CE_documentLoadHandled = true;\n        } else {\n          // If this link's import root is not available, its contents can't be\n          // walked. Wait for 'load' and walk it when it's ready.\n          element.addEventListener('load', () => {\n            const importNode = /** @type {!Node} */ (element.import);\n\n            if (importNode.__CE_documentLoadHandled) return;\n            importNode.__CE_documentLoadHandled = true;\n\n            // Clone the `visitedImports` set that was populated sync during\n            // the `patchAndUpgradeTree` call that caused this 'load' handler to\n            // be added. Then, remove *this* link's import node so that we can\n            // walk that import again, even if it was partially walked later\n            // during the same `patchAndUpgradeTree` call.\n            const clonedVisitedImports = new Set(visitedImports);\n            clonedVisitedImports.delete(importNode);\n\n            this.patchAndUpgradeTree(importNode, {visitedImports: clonedVisitedImports, upgrade});\n          });\n        }\n      } else {\n        elements.push(element);\n      }\n    };\n\n    // `walkDeepDescendantElements` populates (and internally checks against)\n    // `visitedImports` when traversing a loaded import.\n    Utilities.walkDeepDescendantElements(root, gatherElements, visitedImports);\n\n    if (this._hasPatches) {\n      for (let i = 0; i < elements.length; i++) {\n        this.patch(elements[i]);\n      }\n    }\n\n    for (let i = 0; i < elements.length; i++) {\n      upgrade(elements[i]);\n    }\n  }\n\n  /**\n   * @param {!Element} element\n   */\n  upgradeElement(element) {\n    const currentState = element.__CE_state;\n    if (currentState !== undefined) return;\n\n    // Prevent elements created in documents without a browsing context from\n    // upgrading.\n    //\n    // https://html.spec.whatwg.org/multipage/custom-elements.html#look-up-a-custom-element-definition\n    //   \"If document does not have a browsing context, return null.\"\n    //\n    // https://html.spec.whatwg.org/multipage/window-object.html#dom-document-defaultview\n    //   \"The defaultView IDL attribute of the Document interface, on getting,\n    //   must return this Document's browsing context's WindowProxy object, if\n    //   this Document has an associated browsing context, or null otherwise.\"\n    const ownerDocument = element.ownerDocument;\n    if (\n      !ownerDocument.defaultView &&\n      !(ownerDocument.__CE_isImportDocument && ownerDocument.__CE_hasRegistry)\n    ) return;\n\n    const definition = this.localNameToDefinition(element.localName);\n    if (!definition) return;\n\n    definition.constructionStack.push(element);\n\n    const constructor = definition.constructor;\n    try {\n      try {\n        let result = new (constructor)();\n        if (result !== element) {\n          throw new Error('The custom element constructor did not produce the element being upgraded.');\n        }\n      } finally {\n        definition.constructionStack.pop();\n      }\n    } catch (e) {\n      element.__CE_state = CEState.failed;\n      throw e;\n    }\n\n    element.__CE_state = CEState.custom;\n    element.__CE_definition = definition;\n\n    if (definition.attributeChangedCallback) {\n      const observedAttributes = definition.observedAttributes;\n      for (let i = 0; i < observedAttributes.length; i++) {\n        const name = observedAttributes[i];\n        const value = element.getAttribute(name);\n        if (value !== null) {\n          this.attributeChangedCallback(element, name, null, value, null);\n        }\n      }\n    }\n\n    if (Utilities.isConnected(element)) {\n      this.connectedCallback(element);\n    }\n  }\n\n  /**\n   * @param {!Element} element\n   */\n  connectedCallback(element) {\n    const definition = element.__CE_definition;\n    if (definition.connectedCallback) {\n      definition.connectedCallback.call(element);\n    }\n  }\n\n  /**\n   * @param {!Element} element\n   */\n  disconnectedCallback(element) {\n    const definition = element.__CE_definition;\n    if (definition.disconnectedCallback) {\n      definition.disconnectedCallback.call(element);\n    }\n  }\n\n  /**\n   * @param {!Element} element\n   * @param {string} name\n   * @param {?string} oldValue\n   * @param {?string} newValue\n   * @param {?string} namespace\n   */\n  attributeChangedCallback(element, name, oldValue, newValue, namespace) {\n    const definition = element.__CE_definition;\n    if (\n      definition.attributeChangedCallback &&\n      definition.observedAttributes.indexOf(name) > -1\n    ) {\n      definition.attributeChangedCallback.call(element, name, oldValue, newValue, namespace);\n    }\n  }\n}\n","/**\n * @enum {number}\n */\nconst CustomElementState = {\n  custom: 1,\n  failed: 2,\n};\n\nexport default CustomElementState;\n","import CustomElementInternals from './CustomElementInternals.js';\n\nexport default class DocumentConstructionObserver {\n  constructor(internals, doc) {\n    /**\n     * @type {!CustomElementInternals}\n     */\n    this._internals = internals;\n\n    /**\n     * @type {!Document}\n     */\n    this._document = doc;\n\n    /**\n     * @type {MutationObserver|undefined}\n     */\n    this._observer = undefined;\n\n\n    // Simulate tree construction for all currently accessible nodes in the\n    // document.\n    this._internals.patchAndUpgradeTree(this._document);\n\n    if (this._document.readyState === 'loading') {\n      this._observer = new MutationObserver(this._handleMutations.bind(this));\n\n      // Nodes created by the parser are given to the observer *before* the next\n      // task runs. Inline scripts are run in a new task. This means that the\n      // observer will be able to handle the newly parsed nodes before the inline\n      // script is run.\n      this._observer.observe(this._document, {\n        childList: true,\n        subtree: true,\n      });\n    }\n  }\n\n  disconnect() {\n    if (this._observer) {\n      this._observer.disconnect();\n    }\n  }\n\n  /**\n   * @param {!Array<!MutationRecord>} mutations\n   */\n  _handleMutations(mutations) {\n    // Once the document's `readyState` is 'interactive' or 'complete', all new\n    // nodes created within that document will be the result of script and\n    // should be handled by patching.\n    const readyState = this._document.readyState;\n    if (readyState === 'interactive' || readyState === 'complete') {\n      this.disconnect();\n    }\n\n    for (let i = 0; i < mutations.length; i++) {\n      const addedNodes = mutations[i].addedNodes;\n      for (let j = 0; j < addedNodes.length; j++) {\n        const node = addedNodes[j];\n        this._internals.patchAndUpgradeTree(node);\n      }\n    }\n  }\n}\n","import CustomElementInternals from './CustomElementInternals.js';\nimport DocumentConstructionObserver from './DocumentConstructionObserver.js';\nimport Deferred from './Deferred.js';\nimport * as Utilities from './Utilities.js';\n\n/**\n * @unrestricted\n */\nexport default class CustomElementRegistry {\n\n  /**\n   * @param {!CustomElementInternals} internals\n   */\n  constructor(internals) {\n    /**\n     * @private\n     * @type {boolean}\n     */\n    this._elementDefinitionIsRunning = false;\n\n    /**\n     * @private\n     * @type {!CustomElementInternals}\n     */\n    this._internals = internals;\n\n    /**\n     * @private\n     * @type {!Map<string, !Deferred<undefined>>}\n     */\n    this._whenDefinedDeferred = new Map();\n\n    /**\n     * The default flush callback triggers the document walk synchronously.\n     * @private\n     * @type {!Function}\n     */\n    this._flushCallback = fn => fn();\n\n    /**\n     * @private\n     * @type {boolean}\n     */\n    this._flushPending = false;\n\n    /**\n     * @private\n     * @type {!Array<!CustomElementDefinition>}\n     */\n    this._pendingDefinitions = [];\n\n    /**\n     * @private\n     * @type {!DocumentConstructionObserver}\n     */\n    this._documentConstructionObserver = new DocumentConstructionObserver(internals, document);\n  }\n\n  /**\n   * @param {string} localName\n   * @param {!Function} constructor\n   */\n  define(localName, constructor) {\n    if (!(constructor instanceof Function)) {\n      throw new TypeError('Custom element constructors must be functions.');\n    }\n\n    if (!Utilities.isValidCustomElementName(localName)) {\n      throw new SyntaxError(`The element name '${localName}' is not valid.`);\n    }\n\n    if (this._internals.localNameToDefinition(localName)) {\n      throw new Error(`A custom element with name '${localName}' has already been defined.`);\n    }\n\n    if (this._elementDefinitionIsRunning) {\n      throw new Error('A custom element is already being defined.');\n    }\n    this._elementDefinitionIsRunning = true;\n\n    let connectedCallback;\n    let disconnectedCallback;\n    let adoptedCallback;\n    let attributeChangedCallback;\n    let observedAttributes;\n    try {\n      /** @type {!Object} */\n      const prototype = constructor.prototype;\n      if (!(prototype instanceof Object)) {\n        throw new TypeError('The custom element constructor\\'s prototype is not an object.');\n      }\n\n      function getCallback(name) {\n        const callbackValue = prototype[name];\n        if (callbackValue !== undefined && !(callbackValue instanceof Function)) {\n          throw new Error(`The '${name}' callback must be a function.`);\n        }\n        return callbackValue;\n      }\n\n      connectedCallback = getCallback('connectedCallback');\n      disconnectedCallback = getCallback('disconnectedCallback');\n      adoptedCallback = getCallback('adoptedCallback');\n      attributeChangedCallback = getCallback('attributeChangedCallback');\n      observedAttributes = constructor['observedAttributes'] || [];\n    } catch (e) {\n      return;\n    } finally {\n      this._elementDefinitionIsRunning = false;\n    }\n\n    const definition = {\n      localName,\n      constructor,\n      connectedCallback,\n      disconnectedCallback,\n      adoptedCallback,\n      attributeChangedCallback,\n      observedAttributes,\n      constructionStack: [],\n    };\n\n    this._internals.setDefinition(localName, definition);\n    this._pendingDefinitions.push(definition);\n\n    // If we've already called the flush callback and it hasn't called back yet,\n    // don't call it again.\n    if (!this._flushPending) {\n      this._flushPending = true;\n      this._flushCallback(() => this._flush());\n    }\n  }\n\n  upgrade(element) {\n    this._internals.patchAndUpgradeTree(element);\n  }\n\n  _flush() {\n    // If no new definitions were defined, don't attempt to flush. This could\n    // happen if a flush callback keeps the function it is given and calls it\n    // multiple times.\n    if (this._flushPending === false) return;\n    this._flushPending = false;\n\n    const pendingDefinitions = this._pendingDefinitions;\n\n    /**\n     * Unupgraded elements with definitions that were defined *before* the last\n     * flush, in document order.\n     * @type {!Array<!Element>}\n     */\n    const elementsWithStableDefinitions = [];\n\n    /**\n     * A map from `localName`s of definitions that were defined *after* the last\n     * flush to unupgraded elements matching that definition, in document order.\n     * @type {!Map<string, !Array<!Element>>}\n     */\n    const elementsWithPendingDefinitions = new Map();\n    for (let i = 0; i < pendingDefinitions.length; i++) {\n      elementsWithPendingDefinitions.set(pendingDefinitions[i].localName, []);\n    }\n\n    this._internals.patchAndUpgradeTree(document, {\n      upgrade: element => {\n        // Ignore the element if it has already upgraded or failed to upgrade.\n        if (element.__CE_state !== undefined) return;\n\n        const localName = element.localName;\n\n        // If there is an applicable pending definition for the element, add the\n        // element to the list of elements to be upgraded with that definition.\n        const pendingElements = elementsWithPendingDefinitions.get(localName);\n        if (pendingElements) {\n          pendingElements.push(element);\n        // If there is *any other* applicable definition for the element, add it\n        // to the list of elements with stable definitions that need to be upgraded.\n        } else if (this._internals.localNameToDefinition(localName)) {\n          elementsWithStableDefinitions.push(element);\n        }\n      },\n    });\n\n    // Upgrade elements with 'stable' definitions first.\n    for (let i = 0; i < elementsWithStableDefinitions.length; i++) {\n      this._internals.upgradeElement(elementsWithStableDefinitions[i]);\n    }\n\n    // Upgrade elements with 'pending' definitions in the order they were defined.\n    while (pendingDefinitions.length > 0) {\n      const definition = pendingDefinitions.shift();\n      const localName = definition.localName;\n\n      // Attempt to upgrade all applicable elements.\n      const pendingUpgradableElements = elementsWithPendingDefinitions.get(definition.localName);\n      for (let i = 0; i < pendingUpgradableElements.length; i++) {\n        this._internals.upgradeElement(pendingUpgradableElements[i]);\n      }\n\n      // Resolve any promises created by `whenDefined` for the definition.\n      const deferred = this._whenDefinedDeferred.get(localName);\n      if (deferred) {\n        deferred.resolve(undefined);\n      }\n    }\n  }\n\n  /**\n   * @param {string} localName\n   * @return {Function|undefined}\n   */\n  get(localName) {\n    const definition = this._internals.localNameToDefinition(localName);\n    if (definition) {\n      return definition.constructor;\n    }\n\n    return undefined;\n  }\n\n  /**\n   * @param {string} localName\n   * @return {!Promise<undefined>}\n   */\n  whenDefined(localName) {\n    if (!Utilities.isValidCustomElementName(localName)) {\n      return Promise.reject(new SyntaxError(`'${localName}' is not a valid custom element name.`));\n    }\n\n    const prior = this._whenDefinedDeferred.get(localName);\n    if (prior) {\n      return prior.toPromise();\n    }\n\n    const deferred = new Deferred();\n    this._whenDefinedDeferred.set(localName, deferred);\n\n    const definition = this._internals.localNameToDefinition(localName);\n    // Resolve immediately only if the given local name has a definition *and*\n    // the full document walk to upgrade elements with that local name has\n    // already happened.\n    if (definition && !this._pendingDefinitions.some(d => d.localName === localName)) {\n      deferred.resolve(undefined);\n    }\n\n    return deferred.toPromise();\n  }\n\n  polyfillWrapFlushCallback(outer) {\n    this._documentConstructionObserver.disconnect();\n    const inner = this._flushCallback;\n    this._flushCallback = flush => outer(() => inner(flush));\n  }\n}\n\n// Closure compiler exports.\nwindow['CustomElementRegistry'] = CustomElementRegistry;\nCustomElementRegistry.prototype['define'] = CustomElementRegistry.prototype.define;\nCustomElementRegistry.prototype['upgrade'] = CustomElementRegistry.prototype.upgrade;\nCustomElementRegistry.prototype['get'] = CustomElementRegistry.prototype.get;\nCustomElementRegistry.prototype['whenDefined'] = CustomElementRegistry.prototype.whenDefined;\nCustomElementRegistry.prototype['polyfillWrapFlushCallback'] = CustomElementRegistry.prototype.polyfillWrapFlushCallback;\n","/**\n * @template T\n */\nexport default class Deferred {\n  constructor() {\n    /**\n     * @private\n     * @type {T|undefined}\n     */\n    this._value = undefined;\n\n    /**\n     * @private\n     * @type {Function|undefined}\n     */\n    this._resolve = undefined;\n\n    /**\n     * @private\n     * @type {!Promise<T>}\n     */\n    this._promise = new Promise(resolve => {\n      this._resolve = resolve;\n\n      if (this._value) {\n        resolve(this._value);\n      }\n    });\n  }\n\n  /**\n   * @param {T} value\n   */\n  resolve(value) {\n    if (this._value) {\n      throw new Error('Already resolved.');\n    }\n\n    this._value = value;\n\n    if (this._resolve) {\n      this._resolve(value);\n    }\n  }\n\n  /**\n   * @return {!Promise<T>}\n   */\n  toPromise() {\n    return this._promise;\n  }\n}\n","export default {\n  Document_createElement: window.Document.prototype.createElement,\n  Document_createElementNS: window.Document.prototype.createElementNS,\n  Document_importNode: window.Document.prototype.importNode,\n  Document_prepend: window.Document.prototype['prepend'],\n  Document_append: window.Document.prototype['append'],\n  DocumentFragment_prepend: window.DocumentFragment.prototype['prepend'],\n  DocumentFragment_append: window.DocumentFragment.prototype['append'],\n  Node_cloneNode: window.Node.prototype.cloneNode,\n  Node_appendChild: window.Node.prototype.appendChild,\n  Node_insertBefore: window.Node.prototype.insertBefore,\n  Node_removeChild: window.Node.prototype.removeChild,\n  Node_replaceChild: window.Node.prototype.replaceChild,\n  Node_textContent: Object.getOwnPropertyDescriptor(window.Node.prototype, 'textContent'),\n  Element_attachShadow: window.Element.prototype['attachShadow'],\n  Element_innerHTML: Object.getOwnPropertyDescriptor(window.Element.prototype, 'innerHTML'),\n  Element_getAttribute: window.Element.prototype.getAttribute,\n  Element_setAttribute: window.Element.prototype.setAttribute,\n  Element_removeAttribute: window.Element.prototype.removeAttribute,\n  Element_getAttributeNS: window.Element.prototype.getAttributeNS,\n  Element_setAttributeNS: window.Element.prototype.setAttributeNS,\n  Element_removeAttributeNS: window.Element.prototype.removeAttributeNS,\n  Element_insertAdjacentElement: window.Element.prototype['insertAdjacentElement'],\n  Element_insertAdjacentHTML: window.Element.prototype['insertAdjacentHTML'],\n  Element_prepend: window.Element.prototype['prepend'],\n  Element_append: window.Element.prototype['append'],\n  Element_before: window.Element.prototype['before'],\n  Element_after: window.Element.prototype['after'],\n  Element_replaceWith: window.Element.prototype['replaceWith'],\n  Element_remove: window.Element.prototype['remove'],\n  HTMLElement: window.HTMLElement,\n  HTMLElement_innerHTML: Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, 'innerHTML'),\n  HTMLElement_insertAdjacentElement: window.HTMLElement.prototype['insertAdjacentElement'],\n  HTMLElement_insertAdjacentHTML: window.HTMLElement.prototype['insertAdjacentHTML'],\n};\n","/**\n * This class exists only to work around Closure's lack of a way to describe\n * singletons. It represents the 'already constructed marker' used in custom\n * element construction stacks.\n *\n * https://html.spec.whatwg.org/#concept-already-constructed-marker\n */\nclass AlreadyConstructedMarker {}\n\nexport default new AlreadyConstructedMarker();\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport CEState from '../CustomElementState.js';\nimport AlreadyConstructedMarker from '../AlreadyConstructedMarker.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  window['HTMLElement'] = (function() {\n    /**\n     * @type {function(new: HTMLElement): !HTMLElement}\n     */\n    function HTMLElement() {\n      // This should really be `new.target` but `new.target` can't be emulated\n      // in ES5. Assuming the user keeps the default value of the constructor's\n      // prototype's `constructor` property, this is equivalent.\n      /** @type {!Function} */\n      const constructor = this.constructor;\n\n      const definition = internals.constructorToDefinition(constructor);\n      if (!definition) {\n        throw new Error('The custom element being constructed was not registered with `customElements`.');\n      }\n\n      const constructionStack = definition.constructionStack;\n\n      if (constructionStack.length === 0) {\n        const element = Native.Document_createElement.call(document, definition.localName);\n        Object.setPrototypeOf(element, constructor.prototype);\n        element.__CE_state = CEState.custom;\n        element.__CE_definition = definition;\n        internals.patch(element);\n        return element;\n      }\n\n      const lastIndex = constructionStack.length - 1;\n      const element = constructionStack[lastIndex];\n      if (element === AlreadyConstructedMarker) {\n        throw new Error('The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.');\n      }\n      constructionStack[lastIndex] = AlreadyConstructedMarker;\n\n      Object.setPrototypeOf(element, constructor.prototype);\n      internals.patch(/** @type {!HTMLElement} */ (element));\n\n      return element;\n    }\n\n    HTMLElement.prototype = Native.HTMLElement.prototype;\n\n    return HTMLElement;\n  })();\n};\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\nimport CustomElementInternals from './CustomElementInternals.js';\nimport CustomElementRegistry from './CustomElementRegistry.js';\n\nimport PatchHTMLElement from './Patch/HTMLElement.js';\nimport PatchDocument from './Patch/Document.js';\nimport PatchDocumentFragment from './Patch/DocumentFragment.js';\nimport PatchNode from './Patch/Node.js';\nimport PatchElement from './Patch/Element.js';\n\nconst priorCustomElements = window['customElements'];\n\nif (!priorCustomElements ||\n     priorCustomElements['forcePolyfill'] ||\n     (typeof priorCustomElements['define'] != 'function') ||\n     (typeof priorCustomElements['get'] != 'function')) {\n  /** @type {!CustomElementInternals} */\n  const internals = new CustomElementInternals();\n\n  PatchHTMLElement(internals);\n  PatchDocument(internals);\n  PatchDocumentFragment(internals);\n  PatchNode(internals);\n  PatchElement(internals);\n\n  // The main document is always associated with the registry.\n  document.__CE_hasRegistry = true;\n\n  /** @type {!CustomElementRegistry} */\n  const customElements = new CustomElementRegistry(internals);\n\n  Object.defineProperty(window, 'customElements', {\n    configurable: true,\n    enumerable: true,\n    value: customElements,\n  });\n}\n","import CustomElementInternals from '../../CustomElementInternals.js';\nimport * as Utilities from '../../Utilities.js';\n\n/**\n * @typedef {{\n *   prepend: !function(...(!Node|string)),\n  *  append: !function(...(!Node|string)),\n * }}\n */\nlet ParentNodeNativeMethods;\n\n/**\n * @param {!CustomElementInternals} internals\n * @param {!Object} destination\n * @param {!ParentNodeNativeMethods} builtIn\n */\nexport default function(internals, destination, builtIn) {\n  /**\n   * @param {!function(...(!Node|string))} builtInMethod\n   * @return {!function(...(!Node|string))}\n   */\n  function appendPrependPatch(builtInMethod) {\n    return function(...nodes) {\n      /**\n       * A copy of `nodes`, with any DocumentFragment replaced by its children.\n       * @type {!Array<!Node>}\n       */\n      const flattenedNodes = [];\n\n      /**\n       * Elements in `nodes` that were connected before this call.\n       * @type {!Array<!Node>}\n       */\n      const connectedElements = [];\n\n      for (var i = 0; i < nodes.length; i++) {\n        const node = nodes[i];\n\n        if (node instanceof Element && Utilities.isConnected(node)) {\n          connectedElements.push(node);\n        }\n\n        if (node instanceof DocumentFragment) {\n          for (let child = node.firstChild; child; child = child.nextSibling) {\n            flattenedNodes.push(child);\n          }\n        } else {\n          flattenedNodes.push(node);\n        }\n      }\n\n      builtInMethod.apply(this, nodes);\n\n      for (let i = 0; i < connectedElements.length; i++) {\n        internals.disconnectTree(connectedElements[i]);\n      }\n\n      if (Utilities.isConnected(this)) {\n        for (let i = 0; i < flattenedNodes.length; i++) {\n          const node = flattenedNodes[i];\n          if (node instanceof Element) {\n            internals.connectTree(node);\n          }\n        }\n      }\n    };\n  }\n\n  if (builtIn.prepend !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'prepend', appendPrependPatch(builtIn.prepend));\n  }\n\n  if (builtIn.append !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'append', appendPrependPatch(builtIn.append));\n  }\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport * as Utilities from '../Utilities.js';\n\nimport PatchParentNode from './Interface/ParentNode.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  Utilities.setPropertyUnchecked(Document.prototype, 'createElement',\n    /**\n     * @this {Document}\n     * @param {string} localName\n     * @return {!Element}\n     */\n    function(localName) {\n      // Only create custom elements if this document is associated with the registry.\n      if (this.__CE_hasRegistry) {\n        const definition = internals.localNameToDefinition(localName);\n        if (definition) {\n          return new (definition.constructor)();\n        }\n      }\n\n      const result = /** @type {!Element} */\n        (Native.Document_createElement.call(this, localName));\n      internals.patch(result);\n      return result;\n    });\n\n  Utilities.setPropertyUnchecked(Document.prototype, 'importNode',\n    /**\n     * @this {Document}\n     * @param {!Node} node\n     * @param {boolean=} deep\n     * @return {!Node}\n     */\n    function(node, deep) {\n      const clone = Native.Document_importNode.call(this, node, deep);\n      // Only create custom elements if this document is associated with the registry.\n      if (!this.__CE_hasRegistry) {\n        internals.patchTree(clone);\n      } else {\n        internals.patchAndUpgradeTree(clone);\n      }\n      return clone;\n    });\n\n  const NS_HTML = \"http://www.w3.org/1999/xhtml\";\n\n  Utilities.setPropertyUnchecked(Document.prototype, 'createElementNS',\n    /**\n     * @this {Document}\n     * @param {?string} namespace\n     * @param {string} localName\n     * @return {!Element}\n     */\n    function(namespace, localName) {\n      // Only create custom elements if this document is associated with the registry.\n      if (this.__CE_hasRegistry && (namespace === null || namespace === NS_HTML)) {\n        const definition = internals.localNameToDefinition(localName);\n        if (definition) {\n          return new (definition.constructor)();\n        }\n      }\n\n      const result = /** @type {!Element} */\n        (Native.Document_createElementNS.call(this, namespace, localName));\n      internals.patch(result);\n      return result;\n    });\n\n  PatchParentNode(internals, Document.prototype, {\n    prepend: Native.Document_prepend,\n    append: Native.Document_append,\n  });\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport * as Utilities from '../Utilities.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  // `Node#nodeValue` is implemented on `Attr`.\n  // `Node#textContent` is implemented on `Attr`, `Element`.\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'insertBefore',\n    /**\n     * @this {Node}\n     * @param {!Node} node\n     * @param {?Node} refNode\n     * @return {!Node}\n     */\n    function(node, refNode) {\n      if (node instanceof DocumentFragment) {\n        const insertedNodes = Array.prototype.slice.apply(node.childNodes);\n        const nativeResult = Native.Node_insertBefore.call(this, node, refNode);\n\n        // DocumentFragments can't be connected, so `disconnectTree` will never\n        // need to be called on a DocumentFragment's children after inserting it.\n\n        if (Utilities.isConnected(this)) {\n          for (let i = 0; i < insertedNodes.length; i++) {\n            internals.connectTree(insertedNodes[i]);\n          }\n        }\n\n        return nativeResult;\n      }\n\n      const nodeWasConnected = Utilities.isConnected(node);\n      const nativeResult = Native.Node_insertBefore.call(this, node, refNode);\n\n      if (nodeWasConnected) {\n        internals.disconnectTree(node);\n      }\n\n      if (Utilities.isConnected(this)) {\n        internals.connectTree(node);\n      }\n\n      return nativeResult;\n    });\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'appendChild',\n    /**\n     * @this {Node}\n     * @param {!Node} node\n     * @return {!Node}\n     */\n    function(node) {\n      if (node instanceof DocumentFragment) {\n        const insertedNodes = Array.prototype.slice.apply(node.childNodes);\n        const nativeResult = Native.Node_appendChild.call(this, node);\n\n        // DocumentFragments can't be connected, so `disconnectTree` will never\n        // need to be called on a DocumentFragment's children after inserting it.\n\n        if (Utilities.isConnected(this)) {\n          for (let i = 0; i < insertedNodes.length; i++) {\n            internals.connectTree(insertedNodes[i]);\n          }\n        }\n\n        return nativeResult;\n      }\n\n      const nodeWasConnected = Utilities.isConnected(node);\n      const nativeResult = Native.Node_appendChild.call(this, node);\n\n      if (nodeWasConnected) {\n        internals.disconnectTree(node);\n      }\n\n      if (Utilities.isConnected(this)) {\n        internals.connectTree(node);\n      }\n\n      return nativeResult;\n    });\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'cloneNode',\n    /**\n     * @this {Node}\n     * @param {boolean=} deep\n     * @return {!Node}\n     */\n    function(deep) {\n      const clone = Native.Node_cloneNode.call(this, deep);\n      // Only create custom elements if this element's owner document is\n      // associated with the registry.\n      if (!this.ownerDocument.__CE_hasRegistry) {\n        internals.patchTree(clone);\n      } else {\n        internals.patchAndUpgradeTree(clone);\n      }\n      return clone;\n    });\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'removeChild',\n    /**\n     * @this {Node}\n     * @param {!Node} node\n     * @return {!Node}\n     */\n    function(node) {\n      const nodeWasConnected = Utilities.isConnected(node);\n      const nativeResult = Native.Node_removeChild.call(this, node);\n\n      if (nodeWasConnected) {\n        internals.disconnectTree(node);\n      }\n\n      return nativeResult;\n    });\n\n  Utilities.setPropertyUnchecked(Node.prototype, 'replaceChild',\n    /**\n     * @this {Node}\n     * @param {!Node} nodeToInsert\n     * @param {!Node} nodeToRemove\n     * @return {!Node}\n     */\n    function(nodeToInsert, nodeToRemove) {\n      if (nodeToInsert instanceof DocumentFragment) {\n        const insertedNodes = Array.prototype.slice.apply(nodeToInsert.childNodes);\n        const nativeResult = Native.Node_replaceChild.call(this, nodeToInsert, nodeToRemove);\n\n        // DocumentFragments can't be connected, so `disconnectTree` will never\n        // need to be called on a DocumentFragment's children after inserting it.\n\n        if (Utilities.isConnected(this)) {\n          internals.disconnectTree(nodeToRemove);\n          for (let i = 0; i < insertedNodes.length; i++) {\n            internals.connectTree(insertedNodes[i]);\n          }\n        }\n\n        return nativeResult;\n      }\n\n      const nodeToInsertWasConnected = Utilities.isConnected(nodeToInsert);\n      const nativeResult = Native.Node_replaceChild.call(this, nodeToInsert, nodeToRemove);\n      const thisIsConnected = Utilities.isConnected(this);\n\n      if (thisIsConnected) {\n        internals.disconnectTree(nodeToRemove);\n      }\n\n      if (nodeToInsertWasConnected) {\n        internals.disconnectTree(nodeToInsert);\n      }\n\n      if (thisIsConnected) {\n        internals.connectTree(nodeToInsert);\n      }\n\n      return nativeResult;\n    });\n\n\n  function patch_textContent(destination, baseDescriptor) {\n    Object.defineProperty(destination, 'textContent', {\n      enumerable: baseDescriptor.enumerable,\n      configurable: true,\n      get: baseDescriptor.get,\n      set: /** @this {Node} */ function(assignedValue) {\n        // If this is a text node then there are no nodes to disconnect.\n        if (this.nodeType === Node.TEXT_NODE) {\n          baseDescriptor.set.call(this, assignedValue);\n          return;\n        }\n\n        let removedNodes = undefined;\n        // Checking for `firstChild` is faster than reading `childNodes.length`\n        // to compare with 0.\n        if (this.firstChild) {\n          // Using `childNodes` is faster than `children`, even though we only\n          // care about elements.\n          const childNodes = this.childNodes;\n          const childNodesLength = childNodes.length;\n          if (childNodesLength > 0 && Utilities.isConnected(this)) {\n            // Copying an array by iterating is faster than using slice.\n            removedNodes = new Array(childNodesLength);\n            for (let i = 0; i < childNodesLength; i++) {\n              removedNodes[i] = childNodes[i];\n            }\n          }\n        }\n\n        baseDescriptor.set.call(this, assignedValue);\n\n        if (removedNodes) {\n          for (let i = 0; i < removedNodes.length; i++) {\n            internals.disconnectTree(removedNodes[i]);\n          }\n        }\n      },\n    });\n  }\n\n  if (Native.Node_textContent && Native.Node_textContent.get) {\n    patch_textContent(Node.prototype, Native.Node_textContent);\n  } else {\n    internals.addPatch(function(element) {\n      patch_textContent(element, {\n        enumerable: true,\n        configurable: true,\n        // NOTE: This implementation of the `textContent` getter assumes that\n        // text nodes' `textContent` getter will not be patched.\n        get: /** @this {Node} */ function() {\n          /** @type {!Array<string>} */\n          const parts = [];\n\n          for (let i = 0; i < this.childNodes.length; i++) {\n            parts.push(this.childNodes[i].textContent);\n          }\n\n          return parts.join('');\n        },\n        set: /** @this {Node} */ function(assignedValue) {\n          while (this.firstChild) {\n            Native.Node_removeChild.call(this, this.firstChild);\n          }\n          Native.Node_appendChild.call(this, document.createTextNode(assignedValue));\n        },\n      });\n    });\n  }\n};\n","import CustomElementInternals from '../../CustomElementInternals.js';\nimport * as Utilities from '../../Utilities.js';\n\n/**\n * @typedef {{\n *   before: !function(...(!Node|string)),\n *   after: !function(...(!Node|string)),\n *   replaceWith: !function(...(!Node|string)),\n *   remove: !function(),\n * }}\n */\nlet ChildNodeNativeMethods;\n\n/**\n * @param {!CustomElementInternals} internals\n * @param {!Object} destination\n * @param {!ChildNodeNativeMethods} builtIn\n */\nexport default function(internals, destination, builtIn) {\n  /**\n   * @param {!function(...(!Node|string))} builtInMethod\n   * @return {!function(...(!Node|string))}\n   */\n  function beforeAfterPatch(builtInMethod) {\n    return function(...nodes) {\n      /**\n       * A copy of `nodes`, with any DocumentFragment replaced by its children.\n       * @type {!Array<!Node>}\n       */\n      const flattenedNodes = [];\n\n      /**\n       * Elements in `nodes` that were connected before this call.\n       * @type {!Array<!Node>}\n       */\n      const connectedElements = [];\n\n      for (var i = 0; i < nodes.length; i++) {\n        const node = nodes[i];\n\n        if (node instanceof Element && Utilities.isConnected(node)) {\n          connectedElements.push(node);\n        }\n\n        if (node instanceof DocumentFragment) {\n          for (let child = node.firstChild; child; child = child.nextSibling) {\n            flattenedNodes.push(child);\n          }\n        } else {\n          flattenedNodes.push(node);\n        }\n      }\n\n      builtInMethod.apply(this, nodes);\n\n      for (let i = 0; i < connectedElements.length; i++) {\n        internals.disconnectTree(connectedElements[i]);\n      }\n\n      if (Utilities.isConnected(this)) {\n        for (let i = 0; i < flattenedNodes.length; i++) {\n          const node = flattenedNodes[i];\n          if (node instanceof Element) {\n            internals.connectTree(node);\n          }\n        }\n      }\n    };\n  }\n\n  if (builtIn.before !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'before', beforeAfterPatch(builtIn.before));\n  }\n\n  if (builtIn.before !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'after', beforeAfterPatch(builtIn.after));\n  }\n\n  if (builtIn.replaceWith !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'replaceWith',\n      /**\n       * @param {...(!Node|string)} nodes\n       */\n      function(...nodes) {\n        /**\n         * A copy of `nodes`, with any DocumentFragment replaced by its children.\n         * @type {!Array<!Node>}\n         */\n        const flattenedNodes = [];\n\n        /**\n         * Elements in `nodes` that were connected before this call.\n         * @type {!Array<!Node>}\n         */\n        const connectedElements = [];\n\n        for (var i = 0; i < nodes.length; i++) {\n          const node = nodes[i];\n\n          if (node instanceof Element && Utilities.isConnected(node)) {\n            connectedElements.push(node);\n          }\n\n          if (node instanceof DocumentFragment) {\n            for (let child = node.firstChild; child; child = child.nextSibling) {\n              flattenedNodes.push(child);\n            }\n          } else {\n            flattenedNodes.push(node);\n          }\n        }\n\n        const wasConnected = Utilities.isConnected(this);\n\n        builtIn.replaceWith.apply(this, nodes);\n\n        for (let i = 0; i < connectedElements.length; i++) {\n          internals.disconnectTree(connectedElements[i]);\n        }\n\n        if (wasConnected) {\n          internals.disconnectTree(this);\n          for (let i = 0; i < flattenedNodes.length; i++) {\n            const node = flattenedNodes[i];\n            if (node instanceof Element) {\n              internals.connectTree(node);\n            }\n          }\n        }\n      });\n    }\n\n  if (builtIn.remove !== undefined) {\n    Utilities.setPropertyUnchecked(destination, 'remove',\n      function() {\n        const wasConnected = Utilities.isConnected(this);\n\n        builtIn.remove.call(this);\n\n        if (wasConnected) {\n          internals.disconnectTree(this);\n        }\n      });\n  }\n};\n","import Native from './Native.js';\nimport CustomElementInternals from '../CustomElementInternals.js';\nimport CEState from '../CustomElementState.js';\nimport * as Utilities from '../Utilities.js';\n\nimport PatchParentNode from './Interface/ParentNode.js';\nimport PatchChildNode from './Interface/ChildNode.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  if (Native.Element_attachShadow) {\n    Utilities.setPropertyUnchecked(Element.prototype, 'attachShadow',\n      /**\n       * @this {Element}\n       * @param {!{mode: string}} init\n       * @return {ShadowRoot}\n       */\n      function(init) {\n        const shadowRoot = Native.Element_attachShadow.call(this, init);\n        this.__CE_shadowRoot = shadowRoot;\n        return shadowRoot;\n      });\n  }\n\n\n  function patch_innerHTML(destination, baseDescriptor) {\n    Object.defineProperty(destination, 'innerHTML', {\n      enumerable: baseDescriptor.enumerable,\n      configurable: true,\n      get: baseDescriptor.get,\n      set: /** @this {Element} */ function(htmlString) {\n        const isConnected = Utilities.isConnected(this);\n\n        // NOTE: In IE11, when using the native `innerHTML` setter, all nodes\n        // that were previously descendants of the context element have all of\n        // their children removed as part of the set - the entire subtree is\n        // 'disassembled'. This work around walks the subtree *before* using the\n        // native setter.\n        /** @type {!Array<!Element>|undefined} */\n        let removedElements = undefined;\n        if (isConnected) {\n          removedElements = [];\n          Utilities.walkDeepDescendantElements(this, element => {\n            if (element !== this) {\n              removedElements.push(element);\n            }\n          });\n        }\n\n        baseDescriptor.set.call(this, htmlString);\n\n        if (removedElements) {\n          for (let i = 0; i < removedElements.length; i++) {\n            const element = removedElements[i];\n            if (element.__CE_state === CEState.custom) {\n              internals.disconnectedCallback(element);\n            }\n          }\n        }\n\n        // Only create custom elements if this element's owner document is\n        // associated with the registry.\n        if (!this.ownerDocument.__CE_hasRegistry) {\n          internals.patchTree(this);\n        } else {\n          internals.patchAndUpgradeTree(this);\n        }\n        return htmlString;\n      },\n    });\n  }\n\n  if (Native.Element_innerHTML && Native.Element_innerHTML.get) {\n    patch_innerHTML(Element.prototype, Native.Element_innerHTML);\n  } else if (Native.HTMLElement_innerHTML && Native.HTMLElement_innerHTML.get) {\n    patch_innerHTML(HTMLElement.prototype, Native.HTMLElement_innerHTML);\n  } else {\n\n    internals.addPatch(function(element) {\n      patch_innerHTML(element, {\n        enumerable: true,\n        configurable: true,\n        // Implements getting `innerHTML` by performing an unpatched `cloneNode`\n        // of the element and returning the resulting element's `innerHTML`.\n        // TODO: Is this too expensive?\n        get: /** @this {Element} */ function() {\n          return Native.Node_cloneNode.call(this, true).innerHTML;\n        },\n        // Implements setting `innerHTML` by creating an unpatched element,\n        // setting `innerHTML` of that element and replacing the target\n        // element's children with those of the unpatched element.\n        set: /** @this {Element} */ function(assignedValue) {\n          // NOTE: re-route to `content` for `template` elements.\n          // We need to do this because `template.appendChild` does not\n          // route into `template.content`.\n          const isTemplate = (this.localName === 'template');\n          /** @type {!Node} */\n          const content = isTemplate ? (/** @type {!HTMLTemplateElement} */\n            (this)).content : this;\n          /** @type {!Node} */\n          const rawElement = Native.Document_createElement.call(document,\n            this.localName);\n          rawElement.innerHTML = assignedValue;\n\n          while (content.childNodes.length > 0) {\n            Native.Node_removeChild.call(content, content.childNodes[0]);\n          }\n          const container = isTemplate ? rawElement.content : rawElement;\n          while (container.childNodes.length > 0) {\n            Native.Node_appendChild.call(content, container.childNodes[0]);\n          }\n        },\n      });\n    });\n  }\n\n\n  Utilities.setPropertyUnchecked(Element.prototype, 'setAttribute',\n    /**\n     * @this {Element}\n     * @param {string} name\n     * @param {string} newValue\n     */\n    function(name, newValue) {\n      // Fast path for non-custom elements.\n      if (this.__CE_state !== CEState.custom) {\n        return Native.Element_setAttribute.call(this, name, newValue);\n      }\n\n      const oldValue = Native.Element_getAttribute.call(this, name);\n      Native.Element_setAttribute.call(this, name, newValue);\n      newValue = Native.Element_getAttribute.call(this, name);\n      internals.attributeChangedCallback(this, name, oldValue, newValue, null);\n    });\n\n  Utilities.setPropertyUnchecked(Element.prototype, 'setAttributeNS',\n    /**\n     * @this {Element}\n     * @param {?string} namespace\n     * @param {string} name\n     * @param {string} newValue\n     */\n    function(namespace, name, newValue) {\n      // Fast path for non-custom elements.\n      if (this.__CE_state !== CEState.custom) {\n        return Native.Element_setAttributeNS.call(this, namespace, name, newValue);\n      }\n\n      const oldValue = Native.Element_getAttributeNS.call(this, namespace, name);\n      Native.Element_setAttributeNS.call(this, namespace, name, newValue);\n      newValue = Native.Element_getAttributeNS.call(this, namespace, name);\n      internals.attributeChangedCallback(this, name, oldValue, newValue, namespace);\n    });\n\n  Utilities.setPropertyUnchecked(Element.prototype, 'removeAttribute',\n    /**\n     * @this {Element}\n     * @param {string} name\n     */\n    function(name) {\n      // Fast path for non-custom elements.\n      if (this.__CE_state !== CEState.custom) {\n        return Native.Element_removeAttribute.call(this, name);\n      }\n\n      const oldValue = Native.Element_getAttribute.call(this, name);\n      Native.Element_removeAttribute.call(this, name);\n      if (oldValue !== null) {\n        internals.attributeChangedCallback(this, name, oldValue, null, null);\n      }\n    });\n\n  Utilities.setPropertyUnchecked(Element.prototype, 'removeAttributeNS',\n    /**\n     * @this {Element}\n     * @param {?string} namespace\n     * @param {string} name\n     */\n    function(namespace, name) {\n      // Fast path for non-custom elements.\n      if (this.__CE_state !== CEState.custom) {\n        return Native.Element_removeAttributeNS.call(this, namespace, name);\n      }\n\n      const oldValue = Native.Element_getAttributeNS.call(this, namespace, name);\n      Native.Element_removeAttributeNS.call(this, namespace, name);\n      // In older browsers, `Element#getAttributeNS` may return the empty string\n      // instead of null if the attribute does not exist. For details, see;\n      // https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNS#Notes\n      const newValue = Native.Element_getAttributeNS.call(this, namespace, name);\n      if (oldValue !== newValue) {\n        internals.attributeChangedCallback(this, name, oldValue, newValue, namespace);\n      }\n    });\n\n\n  function patch_insertAdjacentElement(destination, baseMethod) {\n    Utilities.setPropertyUnchecked(destination, 'insertAdjacentElement',\n      /**\n       * @this {Element}\n       * @param {string} position\n       * @param {!Element} element\n       * @return {?Element}\n       */\n      function(position, element) {\n        const wasConnected = Utilities.isConnected(element);\n        const insertedElement = /** @type {!Element} */\n          (baseMethod.call(this, position, element));\n\n        if (wasConnected) {\n          internals.disconnectTree(element);\n        }\n\n        if (Utilities.isConnected(insertedElement)) {\n          internals.connectTree(element);\n        }\n        return insertedElement;\n      });\n  }\n\n  if (Native.HTMLElement_insertAdjacentElement) {\n    patch_insertAdjacentElement(HTMLElement.prototype, Native.HTMLElement_insertAdjacentElement);\n  } else if (Native.Element_insertAdjacentElement) {\n    patch_insertAdjacentElement(Element.prototype, Native.Element_insertAdjacentElement);\n  } else {\n    console.warn('Custom Elements: `Element#insertAdjacentElement` was not patched.');\n  }\n\n\n  function patch_insertAdjacentHTML(destination, baseMethod) {\n    /**\n     * Patches and upgrades all nodes which are siblings between `start`\n     * (inclusive) and `end` (exclusive). If `end` is `null`, then all siblings\n     * following `start` will be patched and upgraded.\n     * @param {!Node} start\n     * @param {?Node} end\n     */\n    function upgradeNodesInRange(start, end) {\n      const nodes = [];\n      for (let node = start; node !== end; node = node.nextSibling) {\n        nodes.push(node);\n      }\n      for (let i = 0; i < nodes.length; i++) {\n        internals.patchAndUpgradeTree(nodes[i]);\n      }\n    }\n\n    Utilities.setPropertyUnchecked(destination, 'insertAdjacentHTML',\n      /**\n       * @this {Element}\n       * @param {string} position\n       * @param {string} text\n       */\n      function(position, text) {\n        position = position.toLowerCase();\n\n        if (position === \"beforebegin\") {\n          const marker = this.previousSibling;\n          baseMethod.call(this, position, text);\n          upgradeNodesInRange(\n            /** @type {!Node} */ (marker || this.parentNode.firstChild), this);\n        } else if (position === \"afterbegin\") {\n          const marker = this.firstChild;\n          baseMethod.call(this, position, text);\n          upgradeNodesInRange(/** @type {!Node} */ (this.firstChild), marker);\n        } else if (position === \"beforeend\") {\n          const marker = this.lastChild;\n          baseMethod.call(this, position, text);\n          upgradeNodesInRange(marker || this.firstChild, null);\n        } else if (position === \"afterend\") {\n          const marker = this.nextSibling;\n          baseMethod.call(this, position, text);\n          upgradeNodesInRange(/** @type {!Node} */ (this.nextSibling), marker);\n        } else {\n          throw new SyntaxError(`The value provided (${String(position)}) is ` +\n            \"not one of 'beforebegin', 'afterbegin', 'beforeend', or 'afterend'.\");\n        }\n      });\n  }\n\n  if (Native.HTMLElement_insertAdjacentHTML) {\n    patch_insertAdjacentHTML(HTMLElement.prototype, Native.HTMLElement_insertAdjacentHTML);\n  } else if (Native.Element_insertAdjacentHTML) {\n    patch_insertAdjacentHTML(Element.prototype, Native.Element_insertAdjacentHTML);\n  } else {\n    console.warn('Custom Elements: `Element#insertAdjacentHTML` was not patched.');\n  }\n\n\n  PatchParentNode(internals, Element.prototype, {\n    prepend: Native.Element_prepend,\n    append: Native.Element_append,\n  });\n\n  PatchChildNode(internals, Element.prototype, {\n    before: Native.Element_before,\n    after: Native.Element_after,\n    replaceWith: Native.Element_replaceWith,\n    remove: Native.Element_remove,\n  });\n};\n","import CustomElementInternals from '../CustomElementInternals.js';\nimport Native from './Native.js';\nimport PatchParentNode from './Interface/ParentNode.js';\n\n/**\n * @param {!CustomElementInternals} internals\n */\nexport default function(internals) {\n  PatchParentNode(internals, DocumentFragment.prototype, {\n    prepend: Native.DocumentFragment_prepend,\n    append: Native.DocumentFragment_append,\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/*\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\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\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","/**\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 = style.cloneNode(true);\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} 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 * @param {Element} element\n * @return {?string}\n */\nexport function getCssBuildType(element) {\n  return element.getAttribute('css-build');\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 */\nfunction 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 * @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@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 {StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\nimport * as StyleUtil from './style-util.js';\nimport {nativeShadow} from './style-settings.js';\n\n/* Transforms ShadowDOM styling into ShadyDOM styling\n\n* scoping:\n\n  * elements in scope get scoping selector class=\"x-foo-scope\"\n  * selectors re-written as follows:\n\n    div button -> div.x-foo-scope button.x-foo-scope\n\n* :host -> scopeName\n\n* :host(...) -> scopeName...\n\n* ::slotted(...) -> scopeName > ...\n\n* ...:dir(ltr|rtl) -> [dir=\"ltr|rtl\"] ..., ...[dir=\"ltr|rtl\"]\n\n* :host(:dir[rtl]) -> scopeName:dir(rtl) -> [dir=\"rtl\"] scopeName, scopeName[dir=\"rtl\"]\n\n*/\nconst SCOPE_NAME = 'style-scope';\n\nclass StyleTransformer {\n  get SCOPE_NAME() {\n    return SCOPE_NAME;\n  }\n  /**\n   * Given a node and scope name, add a scoping class to each node\n   * in the tree. This facilitates transforming css into scoped rules.\n   * @param {?} node\n   * @param {?} scope\n   * @param {?=} shouldRemoveScope\n   */\n  dom(node, scope, shouldRemoveScope) {\n    // one time optimization to skip scoping...\n    if (node['__styleScoped']) {\n      node['__styleScoped'] = null;\n    } else {\n      this._transformDom(node, scope || '', shouldRemoveScope);\n    }\n  }\n\n  _transformDom(node, selector, shouldRemoveScope) {\n    if (node.nodeType === Node.ELEMENT_NODE) {\n      this.element(node, selector, shouldRemoveScope);\n    }\n    let c$ = (node.localName === 'template') ?\n      (node.content || node._content).childNodes :\n      node.children || node.childNodes;\n    if (c$) {\n      for (let i=0; i<c$.length; i++) {\n        this._transformDom(c$[i], selector, shouldRemoveScope);\n      }\n    }\n  }\n  /**\n   * @param {?} element\n   * @param {?} scope\n   * @param {?=} shouldRemoveScope\n   */\n  element(element, scope, shouldRemoveScope) {\n    // note: if using classes, we add both the general 'style-scope' class\n    // as well as the specific scope. This enables easy filtering of all\n    // `style-scope` elements\n    if (scope) {\n      // note: svg on IE does not have classList so fallback to class\n      if (element.classList) {\n        if (shouldRemoveScope) {\n          element.classList.remove(SCOPE_NAME);\n          element.classList.remove(scope);\n        } else {\n          element.classList.add(SCOPE_NAME);\n          element.classList.add(scope);\n        }\n      } else if (element.getAttribute) {\n        let c = element.getAttribute(CLASS);\n        if (shouldRemoveScope) {\n          if (c) {\n            let newValue = c.replace(SCOPE_NAME, '').replace(scope, '');\n            StyleUtil.setElementClassRaw(element, newValue);\n          }\n        } else {\n          let newValue = (c ? c + ' ' : '') + SCOPE_NAME + ' ' + scope;\n          StyleUtil.setElementClassRaw(element, newValue);\n        }\n      }\n    }\n  }\n\n  /**\n   * @param {?} element\n   * @param {?} styleRules\n   * @param {?=} callback\n   */\n  elementStyles(element, styleRules, callback) {\n    let cssBuildType = element['__cssBuild'];\n    // no need to shim selectors if settings.useNativeShadow, also\n    // a shady css build will already have transformed selectors\n    // NOTE: This method may be called as part of static or property shimming.\n    // When there is a targeted build it will not be called for static shimming,\n    // but when the property shim is used it is called and should opt out of\n    // static shimming work when a proper build exists.\n    let cssText = '';\n    if (nativeShadow || cssBuildType === 'shady') {\n      cssText = StyleUtil.toCssText(styleRules, callback);\n    } else {\n      let {is, typeExtension} = StyleUtil.getIsExtends(element);\n      cssText = this.css(styleRules, is, typeExtension, callback) + '\\n\\n';\n    }\n    return cssText.trim();\n  }\n\n  // Given a string of cssText and a scoping string (scope), returns\n  // a string of scoped css where each selector is transformed to include\n  // a class created from the scope. ShadowDOM selectors are also transformed\n  // (e.g. :host) to use the scoping selector.\n  css(rules, scope, ext, callback) {\n    let hostScope = this._calcHostScope(scope, ext);\n    scope = this._calcElementScope(scope);\n    let self = this;\n    return StyleUtil.toCssText(rules, function(/** StyleNode */rule) {\n      if (!rule.isScoped) {\n        self.rule(rule, scope, hostScope);\n        rule.isScoped = true;\n      }\n      if (callback) {\n        callback(rule, scope, hostScope);\n      }\n    });\n  }\n\n  _calcElementScope(scope) {\n    if (scope) {\n      return CSS_CLASS_PREFIX + scope;\n    } else {\n      return '';\n    }\n  }\n\n  _calcHostScope(scope, ext) {\n    return ext ? `[is=${scope}]` : scope;\n  }\n\n  rule(rule, scope, hostScope) {\n    this._transformRule(rule, this._transformComplexSelector,\n      scope, hostScope);\n  }\n\n  /**\n   * transforms a css rule to a scoped rule.\n   *\n   * @param {StyleNode} rule\n   * @param {Function} transformer\n   * @param {string=} scope\n   * @param {string=} hostScope\n   */\n  _transformRule(rule, transformer, scope, hostScope) {\n    // NOTE: save transformedSelector for subsequent matching of elements\n    // against selectors (e.g. when calculating style properties)\n    rule['selector'] = rule.transformedSelector =\n      this._transformRuleCss(rule, transformer, scope, hostScope);\n  }\n\n  /**\n   * @param {StyleNode} rule\n   * @param {Function} transformer\n   * @param {string=} scope\n   * @param {string=} hostScope\n   */\n  _transformRuleCss(rule, transformer, scope, hostScope) {\n    let p$ = rule['selector'].split(COMPLEX_SELECTOR_SEP);\n    // we want to skip transformation of rules that appear in keyframes,\n    // because they are keyframe selectors, not element selectors.\n    if (!StyleUtil.isKeyframesSelector(rule)) {\n      for (let i=0, l=p$.length, p; (i<l) && (p=p$[i]); i++) {\n        p$[i] = transformer.call(this, p, scope, hostScope);\n      }\n    }\n    return p$.join(COMPLEX_SELECTOR_SEP);\n  }\n\n  /**\n   * @param {string} selector\n   * @return {string}\n   */\n  _twiddleNthPlus(selector) {\n    return selector.replace(NTH, (m, type, inside) => {\n      if (inside.indexOf('+') > -1) {\n        inside = inside.replace(/\\+/g, '___');\n      } else if (inside.indexOf('___') > -1) {\n        inside = inside.replace(/___/g, '+');\n      }\n      return `:${type}(${inside})`;\n    });\n  }\n\n/**\n * @param {string} selector\n * @param {string} scope\n * @param {string=} hostScope\n */\n  _transformComplexSelector(selector, scope, hostScope) {\n    let stop = false;\n    selector = selector.trim();\n    // Remove spaces inside of selectors like `:nth-of-type` because it confuses SIMPLE_SELECTOR_SEP\n    let isNth = NTH.test(selector);\n    if (isNth) {\n      selector = selector.replace(NTH, (m, type, inner) => `:${type}(${inner.replace(/\\s/g, '')})`)\n      selector = this._twiddleNthPlus(selector);\n    }\n    selector = selector.replace(SLOTTED_START, `${HOST} $1`);\n    selector = selector.replace(SIMPLE_SELECTOR_SEP, (m, c, s) => {\n      if (!stop) {\n        let info = this._transformCompoundSelector(s, c, scope, hostScope);\n        stop = stop || info.stop;\n        c = info.combinator;\n        s = info.value;\n      }\n      return c + s;\n    });\n    if (isNth) {\n      selector = this._twiddleNthPlus(selector);\n    }\n    return selector;\n  }\n\n  _transformCompoundSelector(selector, combinator, scope, hostScope) {\n    // replace :host with host scoping class\n    let slottedIndex = selector.indexOf(SLOTTED);\n    if (selector.indexOf(HOST) >= 0) {\n      selector = this._transformHostSelector(selector, hostScope);\n    // replace other selectors with scoping class\n    } else if (slottedIndex !== 0) {\n      selector = scope ? this._transformSimpleSelector(selector, scope) :\n        selector;\n    }\n    // mark ::slotted() scope jump to replace with descendant selector + arg\n    // also ignore left-side combinator\n    let slotted = false;\n    if (slottedIndex >= 0) {\n      combinator = '';\n      slotted = true;\n    }\n    // process scope jumping selectors up to the scope jump and then stop\n    let stop;\n    if (slotted) {\n      stop = true;\n      if (slotted) {\n        // .zonk ::slotted(.foo) -> .zonk.scope > .foo\n        selector = selector.replace(SLOTTED_PAREN, (m, paren) => ` > ${paren}`);\n      }\n    }\n    selector = selector.replace(DIR_PAREN, (m, before, dir) =>\n      `[dir=\"${dir}\"] ${before}, ${before}[dir=\"${dir}\"]`);\n    return {value: selector, combinator, stop};\n  }\n\n  _transformSimpleSelector(selector, scope) {\n    let p$ = selector.split(PSEUDO_PREFIX);\n    p$[0] += scope;\n    return p$.join(PSEUDO_PREFIX);\n  }\n\n  // :host(...) -> scopeName...\n  _transformHostSelector(selector, hostScope) {\n    let m = selector.match(HOST_PAREN);\n    let paren = m && m[2].trim() || '';\n    if (paren) {\n      if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) {\n        // paren starts with a type selector\n        let typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];\n        // if the type selector is our hostScope then avoid pre-pending it\n        if (typeSelector === hostScope) {\n          return paren;\n        // otherwise, this selector should not match in this scope so\n        // output a bogus selector.\n        } else {\n          return SELECTOR_NO_MATCH;\n        }\n      } else {\n        // make sure to do a replace here to catch selectors like:\n        // `:host(.foo)::before`\n        return selector.replace(HOST_PAREN, function(m, host, paren) {\n          return hostScope + paren;\n        });\n      }\n    // if no paren, do a straight :host replacement.\n    // TODO(sorvell): this should not strictly be necessary but\n    // it's needed to maintain support for `:host[foo]` type selectors\n    // which have been improperly used under Shady DOM. This should be\n    // deprecated.\n    } else {\n      return selector.replace(HOST, hostScope);\n    }\n  }\n\n  /**\n   * @param {StyleNode} rule\n   */\n  documentRule(rule) {\n    // reset selector in case this is redone.\n    rule['selector'] = rule['parsedSelector'];\n    this.normalizeRootSelector(rule);\n    this._transformRule(rule, this._transformDocumentSelector);\n  }\n\n  /**\n   * @param {StyleNode} rule\n   */\n  normalizeRootSelector(rule) {\n    if (rule['selector'] === ROOT) {\n      rule['selector'] = 'html';\n    }\n  }\n\n/**\n * @param {string} selector\n */\n  _transformDocumentSelector(selector) {\n    return selector.match(SLOTTED) ?\n      this._transformComplexSelector(selector, SCOPE_DOC_SELECTOR) :\n      this._transformSimpleSelector(selector.trim(), SCOPE_DOC_SELECTOR);\n  }\n}\n\nlet NTH = /:(nth[-\\w]+)\\(([^)]+)\\)/;\nlet SCOPE_DOC_SELECTOR = `:not(.${SCOPE_NAME})`;\nlet COMPLEX_SELECTOR_SEP = ',';\nlet SIMPLE_SELECTOR_SEP = /(^|[\\s>+~]+)((?:\\[.+?\\]|[^\\s>+~=[])+)/g;\nlet SIMPLE_SELECTOR_PREFIX = /[[.:#*]/;\nlet HOST = ':host';\nlet ROOT = ':root';\nlet SLOTTED = '::slotted';\nlet SLOTTED_START = new RegExp(`^(${SLOTTED})`);\n// NOTE: this supports 1 nested () pair for things like\n// :host(:not([selected]), more general support requires\n// parsing which seems like overkill\nlet HOST_PAREN = /(:host)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\n// similar to HOST_PAREN\nlet SLOTTED_PAREN = /(?:::slotted)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\nlet DIR_PAREN = /(.*):dir\\((?:(ltr|rtl))\\)/;\nlet CSS_CLASS_PREFIX = '.';\nlet PSEUDO_PREFIX = ':';\nlet CLASS = 'class';\nlet SELECTOR_NO_MATCH = 'should_not_match';\n\nexport default new StyleTransformer()\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 {StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\n\n/** @const {string} */\nconst infoKey = '__styleInfo';\n\nexport default class StyleInfo {\n  /**\n   * @param {Element} node\n   * @return {StyleInfo}\n   */\n  static get(node) {\n    if (node) {\n      return node[infoKey];\n    } else {\n      return null;\n    }\n  }\n  /**\n   * @param {!Element} node\n   * @param {StyleInfo} styleInfo\n   * @return {StyleInfo}\n   */\n  static set(node, styleInfo) {\n    node[infoKey] = styleInfo;\n    return styleInfo;\n  }\n  /**\n   * @param {StyleNode} ast\n   * @param {Node=} placeholder\n   * @param {Array<string>=} ownStylePropertyNames\n   * @param {string=} elementName\n   * @param {string=} typeExtension\n   * @param {string=} cssBuild\n   */\n  constructor(ast, placeholder, ownStylePropertyNames, elementName, typeExtension, cssBuild) {\n    /** @type {StyleNode} */\n    this.styleRules = ast || null;\n    /** @type {Node} */\n    this.placeholder = placeholder || null;\n    /** @type {!Array<string>} */\n    this.ownStylePropertyNames = ownStylePropertyNames || [];\n    /** @type {Array<Object>} */\n    this.overrideStyleProperties = null;\n    /** @type {string} */\n    this.elementName = elementName || '';\n    /** @type {string} */\n    this.cssBuild = cssBuild || '';\n    /** @type {string} */\n    this.typeExtension = typeExtension || '';\n    /** @type {Object<string, string>} */\n    this.styleProperties = null;\n    /** @type {?string} */\n    this.scopeSelector = null;\n    /** @type {HTMLStyleElement} */\n    this.customStyle = null;\n  }\n  _getStyleRules() {\n    return this.styleRules;\n  }\n}\n\nStyleInfo.prototype['_getStyleRules'] = StyleInfo.prototype._getStyleRules;","/**\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 {removeCustomPropAssignment, StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\nimport {nativeShadow} from './style-settings.js';\nimport StyleTransformer from './style-transformer.js';\nimport * as StyleUtil from './style-util.js';\nimport * as RX from './common-regex.js';\nimport StyleInfo from './style-info.js';\n\n// TODO: dedupe with shady\n/**\n * @param {string} selector\n * @return {boolean}\n * @this {Element}\n */\nconst matchesSelector = function(selector) {\n  const method = this.matches || this.matchesSelector ||\n    this.mozMatchesSelector || this.msMatchesSelector ||\n    this.oMatchesSelector || this.webkitMatchesSelector;\n  return method && method.call(this, selector);\n};\n\nconst IS_IE = navigator.userAgent.match('Trident');\n\nconst XSCOPE_NAME = 'x-scope';\n\nclass StyleProperties {\n  get XSCOPE_NAME() {\n    return XSCOPE_NAME;\n  }\n/**\n * decorates styles with rule info and returns an array of used style property names\n *\n * @param {StyleNode} rules\n * @return {Array<string>}\n */\n  decorateStyles(rules) {\n    let self = this, props = {}, keyframes = [], ruleIndex = 0;\n    StyleUtil.forEachRule(rules, function(rule) {\n      self.decorateRule(rule);\n      // mark in-order position of ast rule in styles block, used for cache key\n      rule.index = ruleIndex++;\n      self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);\n    }, function onKeyframesRule(rule) {\n      keyframes.push(rule);\n    });\n    // Cache all found keyframes rules for later reference:\n    rules._keyframes = keyframes;\n    // return this list of property names *consumes* in these styles.\n    let names = [];\n    for (let i in props) {\n      names.push(i);\n    }\n    return names;\n  }\n\n  // decorate a single rule with property info\n  decorateRule(rule) {\n    if (rule.propertyInfo) {\n      return rule.propertyInfo;\n    }\n    let info = {}, properties = {};\n    let hasProperties = this.collectProperties(rule, properties);\n    if (hasProperties) {\n      info.properties = properties;\n      // TODO(sorvell): workaround parser seeing mixins as additional rules\n      rule['rules'] = null;\n    }\n    info.cssText = this.collectCssText(rule);\n    rule.propertyInfo = info;\n    return info;\n  }\n\n  // collects the custom properties from a rule's cssText\n  collectProperties(rule, properties) {\n    let info = rule.propertyInfo;\n    if (info) {\n      if (info.properties) {\n        Object.assign(properties, info.properties);\n        return true;\n      }\n    } else {\n      let m, rx = RX.VAR_ASSIGN;\n      let cssText = rule['parsedCssText'];\n      let value;\n      let any;\n      while ((m = rx.exec(cssText))) {\n        // note: group 2 is var, 3 is mixin\n        value = (m[2] || m[3]).trim();\n        // value of 'inherit' or 'unset' is equivalent to not setting the property here\n        if (value !== 'inherit' || value !== 'unset') {\n          properties[m[1].trim()] = value;\n        }\n        any = true;\n      }\n      return any;\n    }\n\n  }\n\n  // returns cssText of properties that consume variables/mixins\n  collectCssText(rule) {\n    return this.collectConsumingCssText(rule['parsedCssText']);\n  }\n\n  // NOTE: we support consumption inside mixin assignment\n  // but not production, so strip out {...}\n  collectConsumingCssText(cssText) {\n    return cssText.replace(RX.BRACKETED, '')\n      .replace(RX.VAR_ASSIGN, '');\n  }\n\n  collectPropertiesInCssText(cssText, props) {\n    let m;\n    while ((m = RX.VAR_CONSUMED.exec(cssText))) {\n      let name = m[1];\n      // This regex catches all variable names, and following non-whitespace char\n      // If next char is not ':', then variable is a consumer\n      if (m[2] !== ':') {\n        props[name] = true;\n      }\n    }\n  }\n\n  // turns custom properties into realized values.\n  reify(props) {\n    // big perf optimization here: reify only *own* properties\n    // since this object has __proto__ of the element's scope properties\n    let names = Object.getOwnPropertyNames(props);\n    for (let i=0, n; i < names.length; i++) {\n      n = names[i];\n      props[n] = this.valueForProperty(props[n], props);\n    }\n  }\n\n  // given a property value, returns the reified value\n  // a property value may be:\n  // (1) a literal value like: red or 5px;\n  // (2) a variable value like: var(--a), var(--a, red), or var(--a, --b) or\n  // var(--a, var(--b));\n  // (3) a literal mixin value like { properties }. Each of these properties\n  // can have values that are: (a) literal, (b) variables, (c) @apply mixins.\n  valueForProperty(property, props) {\n    // case (1) default\n    // case (3) defines a mixin and we have to reify the internals\n    if (property) {\n      if (property.indexOf(';') >=0) {\n        property = this.valueForProperties(property, props);\n      } else {\n        // case (2) variable\n        let self = this;\n        let fn = function(prefix, value, fallback, suffix) {\n          if (!value) {\n            return prefix + suffix;\n          }\n          let propertyValue = self.valueForProperty(props[value], props);\n          // if value is \"initial\", then the variable should be treated as unset\n          if (!propertyValue || propertyValue === 'initial') {\n            // fallback may be --a or var(--a) or literal\n            propertyValue = self.valueForProperty(props[fallback] || fallback, props) ||\n            fallback;\n          } else if (propertyValue === 'apply-shim-inherit') {\n            // CSS build will replace `inherit` with `apply-shim-inherit`\n            // for use with native css variables.\n            // Since we have full control, we can use `inherit` directly.\n            propertyValue = 'inherit';\n          }\n          return prefix + (propertyValue || '') + suffix;\n        };\n        property = StyleUtil.processVariableAndFallback(property, fn);\n      }\n    }\n    return property && property.trim() || '';\n  }\n\n  // note: we do not yet support mixin within mixin\n  valueForProperties(property, props) {\n    let parts = property.split(';');\n    for (let i=0, p, m; i<parts.length; i++) {\n      if ((p = parts[i])) {\n        RX.MIXIN_MATCH.lastIndex = 0;\n        m = RX.MIXIN_MATCH.exec(p);\n        if (m) {\n          p = this.valueForProperty(props[m[1]], props);\n        } else {\n          let colon = p.indexOf(':');\n          if (colon !== -1) {\n            let pp = p.substring(colon);\n            pp = pp.trim();\n            pp = this.valueForProperty(pp, props) || pp;\n            p = p.substring(0, colon) + pp;\n          }\n        }\n        parts[i] = (p && p.lastIndexOf(';') === p.length - 1) ?\n          // strip trailing ;\n          p.slice(0, -1) :\n          p || '';\n      }\n    }\n    return parts.join(';');\n  }\n\n  applyProperties(rule, props) {\n    let output = '';\n    // dynamically added sheets may not be decorated so ensure they are.\n    if (!rule.propertyInfo) {\n      this.decorateRule(rule);\n    }\n    if (rule.propertyInfo.cssText) {\n      output = this.valueForProperties(rule.propertyInfo.cssText, props);\n    }\n    rule['cssText'] = output;\n  }\n\n  // Apply keyframe transformations to the cssText of a given rule. The\n  // keyframeTransforms object is a map of keyframe names to transformer\n  // functions which take in cssText and spit out transformed cssText.\n  applyKeyframeTransforms(rule, keyframeTransforms) {\n    let input = rule['cssText'];\n    let output = rule['cssText'];\n    if (rule.hasAnimations == null) {\n      // Cache whether or not the rule has any animations to begin with:\n      rule.hasAnimations = RX.ANIMATION_MATCH.test(input);\n    }\n    // If there are no animations referenced, we can skip transforms:\n    if (rule.hasAnimations) {\n      let transform;\n      // If we haven't transformed this rule before, we iterate over all\n      // transforms:\n      if (rule.keyframeNamesToTransform == null) {\n        rule.keyframeNamesToTransform = [];\n        for (let keyframe in keyframeTransforms) {\n          transform = keyframeTransforms[keyframe];\n          output = transform(input);\n          // If the transform actually changed the CSS text, we cache the\n          // transform name for future use:\n          if (input !== output) {\n            input = output;\n            rule.keyframeNamesToTransform.push(keyframe);\n          }\n        }\n      } else {\n        // If we already have a list of keyframe names that apply to this\n        // rule, we apply only those keyframe name transforms:\n        for (let i = 0; i < rule.keyframeNamesToTransform.length; ++i) {\n          transform = keyframeTransforms[rule.keyframeNamesToTransform[i]];\n          input = transform(input);\n        }\n        output = input;\n      }\n    }\n    rule['cssText'] = output;\n  }\n\n  // Test if the rules in these styles matches the given `element` and if so,\n  // collect any custom properties into `props`.\n  /**\n   * @param {StyleNode} rules\n   * @param {Element} element\n   */\n  propertyDataFromStyles(rules, element) {\n    let props = {}, self = this;\n    // generates a unique key for these matches\n    let o = [];\n    // note: active rules excludes non-matching @media rules\n    StyleUtil.forEachRule(rules, function(rule) {\n      // TODO(sorvell): we could trim the set of rules at declaration\n      // time to only include ones that have properties\n      if (!rule.propertyInfo) {\n        self.decorateRule(rule);\n      }\n      // match element against transformedSelector: selector may contain\n      // unwanted uniquification and parsedSelector does not directly match\n      // for :host selectors.\n      let selectorToMatch = rule.transformedSelector || rule['parsedSelector'];\n      if (element && rule.propertyInfo.properties && selectorToMatch) {\n        if (matchesSelector.call(element, selectorToMatch)) {\n          self.collectProperties(rule, props);\n          // produce numeric key for these matches for lookup\n          addToBitMask(rule.index, o);\n        }\n      }\n    }, null, true);\n    return {properties: props, key: o};\n  }\n\n  /**\n   * @param {Element} scope\n   * @param {StyleNode} rule\n   * @param {string|undefined} cssBuild\n   * @param {function(Object)} callback\n   */\n  whenHostOrRootRule(scope, rule, cssBuild, callback) {\n    if (!rule.propertyInfo) {\n      this.decorateRule(rule);\n    }\n    if (!rule.propertyInfo.properties) {\n      return;\n    }\n    let {is, typeExtension} = StyleUtil.getIsExtends(scope);\n    let hostScope = is ?\n      StyleTransformer._calcHostScope(is, typeExtension) :\n      'html';\n    let parsedSelector = rule['parsedSelector'];\n    let isRoot = (parsedSelector === ':host > *' || parsedSelector === 'html');\n    let isHost = parsedSelector.indexOf(':host') === 0 && !isRoot;\n    // build info is either in scope (when scope is an element) or in the style\n    // when scope is the default scope; note: this allows default scope to have\n    // mixed mode built and unbuilt styles.\n    if (cssBuild === 'shady') {\n      // :root -> x-foo > *.x-foo for elements and html for custom-style\n      isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;\n      // :host -> x-foo for elements, but sub-rules have .x-foo in them\n      isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;\n    }\n    if (cssBuild === 'shadow') {\n      isRoot = parsedSelector === ':host > *' || parsedSelector === 'html';\n      isHost = isHost && !isRoot;\n    }\n    if (!isRoot && !isHost) {\n      return;\n    }\n    let selectorToMatch = hostScope;\n    if (isHost) {\n      // need to transform :host because `:host` does not work with `matches`\n      if (!rule.transformedSelector) {\n        // transform :host into a matchable selector\n        rule.transformedSelector =\n        StyleTransformer._transformRuleCss(\n          rule,\n          StyleTransformer._transformComplexSelector,\n          StyleTransformer._calcElementScope(is),\n          hostScope\n        );\n      }\n      selectorToMatch = rule.transformedSelector || hostScope;\n    }\n    callback({\n      selector: selectorToMatch,\n      isHost: isHost,\n      isRoot: isRoot\n    });\n  }\n/**\n * @param {Element} scope\n * @param {StyleNode} rules\n * @return {Object}\n */\n  hostAndRootPropertiesForScope(scope, rules) {\n    let hostProps = {}, rootProps = {}, self = this;\n    // note: active rules excludes non-matching @media rules\n    let cssBuild = rules && rules['__cssBuild'];\n    StyleUtil.forEachRule(rules, function(rule) {\n      // if scope is StyleDefaults, use _element for matchesSelector\n      self.whenHostOrRootRule(scope, rule, cssBuild, function(info) {\n        let element = scope._element || scope;\n        if (matchesSelector.call(element, info.selector)) {\n          if (info.isHost) {\n            self.collectProperties(rule, hostProps);\n          } else {\n            self.collectProperties(rule, rootProps);\n          }\n        }\n      });\n    }, null, true);\n    return {rootProps: rootProps, hostProps: hostProps};\n  }\n\n  /**\n   * @param {Element} element\n   * @param {Object} properties\n   * @param {string} scopeSelector\n   */\n  transformStyles(element, properties, scopeSelector) {\n    let self = this;\n    let {is, typeExtension} = StyleUtil.getIsExtends(element);\n    let hostSelector = StyleTransformer\n      ._calcHostScope(is, typeExtension);\n    let rxHostSelector = element.extends ?\n      '\\\\' + hostSelector.slice(0, -1) + '\\\\]' :\n      hostSelector;\n    let hostRx = new RegExp(RX.HOST_PREFIX + rxHostSelector +\n      RX.HOST_SUFFIX);\n    let rules = StyleInfo.get(element).styleRules;\n    let keyframeTransforms =\n      this._elementKeyframeTransforms(element, rules, scopeSelector);\n    return StyleTransformer.elementStyles(element, rules, function(rule) {\n      self.applyProperties(rule, properties);\n      if (!nativeShadow &&\n          !StyleUtil.isKeyframesSelector(rule) &&\n          rule['cssText']) {\n        // NOTE: keyframe transforms only scope munge animation names, so it\n        // is not necessary to apply them in ShadowDOM.\n        self.applyKeyframeTransforms(rule, keyframeTransforms);\n        self._scopeSelector(rule, hostRx, hostSelector, scopeSelector);\n      }\n    });\n  }\n\n  /**\n   * @param {Element} element\n   * @param {StyleNode} rules\n   * @param {string} scopeSelector\n   * @return {Object}\n   */\n  _elementKeyframeTransforms(element, rules, scopeSelector) {\n    let keyframesRules = rules._keyframes;\n    let keyframeTransforms = {};\n    if (!nativeShadow && keyframesRules) {\n      // For non-ShadowDOM, we transform all known keyframes rules in\n      // advance for the current scope. This allows us to catch keyframes\n      // rules that appear anywhere in the stylesheet:\n      for (let i = 0, keyframesRule = keyframesRules[i];\n           i < keyframesRules.length;\n           keyframesRule = keyframesRules[++i]) {\n        this._scopeKeyframes(keyframesRule, scopeSelector);\n        keyframeTransforms[keyframesRule['keyframesName']] =\n            this._keyframesRuleTransformer(keyframesRule);\n      }\n    }\n    return keyframeTransforms;\n  }\n\n  // Generate a factory for transforming a chunk of CSS text to handle a\n  // particular scoped keyframes rule.\n  /**\n   * @param {StyleNode} keyframesRule\n   * @return {function(string):string}\n   */\n  _keyframesRuleTransformer(keyframesRule) {\n    return function(cssText) {\n      return cssText.replace(\n          keyframesRule.keyframesNameRx,\n          keyframesRule.transformedKeyframesName);\n    };\n  }\n\n/**\n * Transforms `@keyframes` names to be unique for the current host.\n * Example: @keyframes foo-anim -> @keyframes foo-anim-x-foo-0\n *\n * @param {StyleNode} rule\n * @param {string} scopeId\n */\n  _scopeKeyframes(rule, scopeId) {\n    // Animation names are of the form [\\w-], so ensure that the name regex does not partially apply\n    // to similarly named keyframe names by checking for a word boundary at the beginning and\n    // a non-word boundary or `-` at the end.\n    rule.keyframesNameRx = new RegExp(`\\\\b${rule['keyframesName']}(?!\\\\B|-)`, 'g');\n    rule.transformedKeyframesName = rule['keyframesName'] + '-' + scopeId;\n    rule.transformedSelector = rule.transformedSelector || rule['selector'];\n    rule['selector'] = rule.transformedSelector.replace(\n        rule['keyframesName'], rule.transformedKeyframesName);\n  }\n\n  // Strategy: x scope shim a selector e.g. to scope `.x-foo-42` (via classes):\n  // non-host selector: .a.x-foo -> .x-foo-42 .a.x-foo\n  // host selector: x-foo.wide -> .x-foo-42.wide\n  // note: we use only the scope class (.x-foo-42) and not the hostSelector\n  // (x-foo) to scope :host rules; this helps make property host rules\n  // have low specificity. They are overrideable by class selectors but,\n  // unfortunately, not by type selectors (e.g. overriding via\n  // `.special` is ok, but not by `x-foo`).\n  /**\n   * @param {StyleNode} rule\n   * @param {RegExp} hostRx\n   * @param {string} hostSelector\n   * @param {string} scopeId\n   */\n  _scopeSelector(rule, hostRx, hostSelector, scopeId) {\n    rule.transformedSelector = rule.transformedSelector || rule['selector'];\n    let selector = rule.transformedSelector;\n    let scope = '.' + scopeId;\n    let parts = selector.split(',');\n    for (let i=0, l=parts.length, p; (i<l) && (p=parts[i]); i++) {\n      parts[i] = p.match(hostRx) ?\n        p.replace(hostSelector, scope) :\n        scope + ' ' + p;\n    }\n    rule['selector'] = parts.join(',');\n  }\n\n  /**\n   * @param {Element} element\n   * @param {string} selector\n   * @param {string} old\n   */\n  applyElementScopeSelector(element, selector, old) {\n    let c = element.getAttribute('class') || '';\n    let v = c;\n    if (old) {\n      v = c.replace(\n        new RegExp('\\\\s*' + XSCOPE_NAME + '\\\\s*' + old + '\\\\s*', 'g'), ' ');\n    }\n    v += (v ? ' ' : '') + XSCOPE_NAME + ' ' + selector;\n    if (c !== v) {\n      StyleUtil.setElementClassRaw(element, v);\n    }\n  }\n\n  /**\n   * @param {HTMLElement} element\n   * @param {Object} properties\n   * @param {string} selector\n   * @param {HTMLStyleElement} style\n   * @return {HTMLStyleElement}\n   */\n  applyElementStyle(element, properties, selector, style) {\n    // calculate cssText to apply\n    let cssText = style ? style.textContent || '' :\n      this.transformStyles(element, properties, selector);\n    // if shady and we have a cached style that is not style, decrement\n    let styleInfo = StyleInfo.get(element);\n    let s = styleInfo.customStyle;\n    if (s && !nativeShadow && (s !== style)) {\n      s['_useCount']--;\n      if (s['_useCount'] <= 0 && s.parentNode) {\n        s.parentNode.removeChild(s);\n      }\n    }\n    // apply styling always under native or if we generated style\n    // or the cached style is not in document(!)\n    if (nativeShadow) {\n      // update existing style only under native\n      if (styleInfo.customStyle) {\n        styleInfo.customStyle.textContent = cssText;\n        style = styleInfo.customStyle;\n      // otherwise, if we have css to apply, do so\n      } else if (cssText) {\n        // apply css after the scope style of the element to help with\n        // style precedence rules.\n        style = StyleUtil.applyCss(cssText, selector, element.shadowRoot,\n          styleInfo.placeholder);\n      }\n    } else {\n      // shady and no cache hit\n      if (!style) {\n        // apply css after the scope style of the element to help with\n        // style precedence rules.\n        if (cssText) {\n          style = StyleUtil.applyCss(cssText, selector, null,\n            styleInfo.placeholder);\n        }\n      // shady and cache hit but not in document\n      } else if (!style.parentNode) {\n        if (IS_IE && cssText.indexOf('@media') > -1) {\n            // @media rules may be stale in IE 10 and 11\n            // refresh the text content of the style to revalidate them.\n          style.textContent = cssText;\n        }\n        StyleUtil.applyStyle(style, null, styleInfo.placeholder);\n      }\n    }\n    // ensure this style is our custom style and increment its use count.\n    if (style) {\n      style['_useCount'] = style['_useCount'] || 0;\n      // increment use count if we changed styles\n      if (styleInfo.customStyle != style) {\n        style['_useCount']++;\n      }\n      styleInfo.customStyle = style;\n    }\n    return style;\n  }\n\n  /**\n   * @param {Element} style\n   * @param {Object} properties\n   */\n  applyCustomStyle(style, properties) {\n    let rules = StyleUtil.rulesForStyle(/** @type {HTMLStyleElement} */(style));\n    let self = this;\n    style.textContent = StyleUtil.toCssText(rules, function(/** StyleNode */rule) {\n      let css = rule['cssText'] = rule['parsedCssText'];\n      if (rule.propertyInfo && rule.propertyInfo.cssText) {\n        // remove property assignments\n        // so next function isn't confused\n        // NOTE: we have 3 categories of css:\n        // (1) normal properties,\n        // (2) custom property assignments (--foo: red;),\n        // (3) custom property usage: border: var(--foo); @apply(--foo);\n        // In elements, 1 and 3 are separated for efficiency; here they\n        // are not and this makes this case unique.\n        css = removeCustomPropAssignment(/** @type {string} */(css));\n        // replace with reified properties, scenario is same as mixin\n        rule['cssText'] = self.valueForProperties(css, properties);\n      }\n    });\n  }\n}\n\n/**\n * @param {number} n\n * @param {Array<number>} bits\n */\nfunction addToBitMask(n, bits) {\n  let o = parseInt(n / 32, 10);\n  let v = 1 << (n % 32);\n  bits[o] = (bits[o] || 0) | v;\n}\n\nexport default new StyleProperties();","/**\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 {applyStylePlaceHolder} from './style-util.js';\nimport {nativeShadow} from './style-settings.js';\n\n/** @type {Object<string, !Node>} */\nlet placeholderMap = {};\n\n/**\n * @const {CustomElementRegistry}\n */\nconst ce = window['customElements'];\nif (ce && !nativeShadow) {\n  /**\n   * @const {function(this:CustomElementRegistry, string,function(new:HTMLElement),{extends: string}=)}\n   */\n  const origDefine = ce['define'];\n  /**\n   * @param {string} name\n   * @param {function(new:HTMLElement)} clazz\n   * @param {{extends: string}=} options\n   */\n  const wrappedDefine = (name, clazz, options) => {\n    placeholderMap[name] = applyStylePlaceHolder(name);\n    origDefine.call(/** @type {!CustomElementRegistry} */(ce), name, clazz, options);\n  };\n  ce['define'] = wrappedDefine;\n}\n\nexport default placeholderMap;\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'use strict';\n\nexport default class StyleCache {\n  constructor(typeMax = 100) {\n    // map element name -> [{properties, styleElement, scopeSelector}]\n    this.cache = {};\n    this.typeMax = typeMax;\n  }\n\n  _validate(cacheEntry, properties, ownPropertyNames) {\n    for (let idx = 0; idx < ownPropertyNames.length; idx++) {\n      let pn = ownPropertyNames[idx];\n      if (cacheEntry.properties[pn] !== properties[pn]) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  store(tagname, properties, styleElement, scopeSelector) {\n    let list = this.cache[tagname] || [];\n    list.push({properties, styleElement, scopeSelector});\n    if (list.length > this.typeMax) {\n      list.shift();\n    }\n    this.cache[tagname] = list;\n  }\n\n  fetch(tagname, properties, ownPropertyNames) {\n    let list = this.cache[tagname];\n    if (!list) {\n      return;\n    }\n    // reverse list for most-recent lookups\n    for (let idx = list.length - 1; idx >= 0; idx--) {\n      let entry = list[idx];\n      if (this._validate(entry, properties, ownPropertyNames)) {\n        return entry;\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*/\n\n'use strict';\n\nimport {nativeShadow} from './style-settings.js';\nimport StyleTransformer from './style-transformer.js';\nimport {getIsExtends} from './style-util.js';\n\nexport let flush = function() {};\n\n/**\n * @param {HTMLElement} element\n * @return {!Array<string>}\n */\nfunction getClasses(element) {\n  let classes = [];\n  if (element.classList) {\n    classes = Array.from(element.classList);\n  } else if (element instanceof window['SVGElement'] && element.hasAttribute('class')) {\n    classes = element.getAttribute('class').split(/\\s+/);\n  }\n  return classes;\n}\n\n/**\n * @param {HTMLElement} element\n * @return {string}\n */\nfunction getCurrentScope(element) {\n  let classes = getClasses(element);\n  let idx = classes.indexOf(StyleTransformer.SCOPE_NAME);\n  if (idx > -1) {\n    return classes[idx + 1];\n  }\n  return '';\n}\n\n/**\n * @param {Array<MutationRecord|null>|null} mxns\n */\nfunction handler(mxns) {\n  for (let x=0; x < mxns.length; x++) {\n    let mxn = mxns[x];\n    if (mxn.target === document.documentElement ||\n      mxn.target === document.head) {\n      continue;\n    }\n    for (let i=0; i < mxn.addedNodes.length; i++) {\n      let n = mxn.addedNodes[i];\n      if (n.nodeType !== Node.ELEMENT_NODE) {\n        continue;\n      }\n      n = /** @type {HTMLElement} */(n); // eslint-disable-line no-self-assign\n      let root = n.getRootNode();\n      let currentScope = getCurrentScope(n);\n      // node was scoped, but now is in document\n      if (currentScope && root === n.ownerDocument) {\n        StyleTransformer.dom(n, currentScope, true);\n      } else if (root.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n        let newScope;\n        let host = /** @type {ShadowRoot} */(root).host;\n        // element may no longer be in a shadowroot\n        if (!host) {\n          continue;\n        }\n        newScope = getIsExtends(host).is;\n        if (currentScope === newScope) {\n          // make sure all the subtree elements are scoped correctly\n          let unscoped = window['ShadyDOM']['nativeMethods']['querySelectorAll'].call(\n            n, `:not(.${StyleTransformer.SCOPE_NAME})`);\n          for (let j = 0; j < unscoped.length; j++) {\n            StyleTransformer.element(unscoped[j], currentScope);\n          }\n          continue;\n        }\n        if (currentScope) {\n          StyleTransformer.dom(n, currentScope, true);\n        }\n        StyleTransformer.dom(n, newScope);\n      }\n    }\n  }\n}\n\nif (!nativeShadow) {\n  let observer = new MutationObserver(handler);\n  let start = (node) => {\n    observer.observe(node, {childList: true, subtree: true});\n  }\n  let nativeCustomElements = (window['customElements'] &&\n    !window['customElements']['polyfillWrapFlushCallback']);\n  // need to start immediately with native custom elements\n  // TODO(dfreedm): with polyfilled HTMLImports and native custom elements\n  // excessive mutations may be observed; this can be optimized via cooperation\n  // with the HTMLImports polyfill.\n  if (nativeCustomElements) {\n    start(document);\n  } else {\n    let delayedStart = () => {\n      start(document.body);\n    }\n    // use polyfill timing if it's available\n    if (window['HTMLImports']) {\n      window['HTMLImports']['whenReady'](delayedStart);\n    // otherwise push beyond native imports being ready\n    // which requires RAF + readystate interactive.\n    } else {\n      requestAnimationFrame(function() {\n        if (document.readyState === 'loading') {\n          let listener = function() {\n            delayedStart();\n            document.removeEventListener('readystatechange', listener);\n          }\n          document.addEventListener('readystatechange', listener);\n        } else {\n          delayedStart();\n        }\n      });\n    }\n  }\n\n  flush = function() {\n    handler(observer.takeRecords());\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\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@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 {parse, StyleNode} from './css-parse.js';\nimport {nativeShadow, nativeCssVariables} from './style-settings.js';\nimport StyleTransformer from './style-transformer.js';\nimport * as StyleUtil from './style-util.js';\nimport StyleProperties from './style-properties.js';\nimport placeholderMap from './style-placeholder.js';\nimport StyleInfo from './style-info.js';\nimport StyleCache from './style-cache.js';\nimport {flush as watcherFlush} from './document-watcher.js';\nimport templateMap from './template-map.js';\nimport * as ApplyShimUtils from './apply-shim-utils.js';\nimport documentWait from './document-wait.js';\nimport {updateNativeProperties, detectMixin} from './common-utils.js';\nimport {CustomStyleInterfaceInterface} from './custom-style-interface.js'; // eslint-disable-line no-unused-vars\n\n/**\n * @const {StyleCache}\n */\nconst styleCache = new StyleCache();\n\nexport default class ScopingShim {\n  constructor() {\n    this._scopeCounter = {};\n    this._documentOwner = document.documentElement;\n    let ast = new StyleNode();\n    ast['rules'] = [];\n    this._documentOwnerStyleInfo = StyleInfo.set(this._documentOwner, new StyleInfo(ast));\n    this._elementsHaveApplied = false;\n    this._applyShim = null;\n    /** @type {?CustomStyleInterfaceInterface} */\n    this._customStyleInterface = null;\n    documentWait(() => {\n      this._ensure();\n    });\n  }\n  flush() {\n    watcherFlush();\n  }\n  _generateScopeSelector(name) {\n    let id = this._scopeCounter[name] = (this._scopeCounter[name] || 0) + 1;\n    return `${name}-${id}`;\n  }\n  getStyleAst(style) {\n    return StyleUtil.rulesForStyle(style);\n  }\n  styleAstToString(ast) {\n    return StyleUtil.toCssText(ast);\n  }\n  _gatherStyles(template) {\n    return StyleUtil.gatherStyleText(template.content);\n  }\n  _getCssBuild(template) {\n    let style = template.content.querySelector('style');\n    if (!style) {\n      return '';\n    }\n    return style.getAttribute('css-build') || '';\n  }\n  /**\n   * Prepare the styling and template for the given element type\n   *\n   * @param {HTMLTemplateElement} template\n   * @param {string} elementName\n   * @param {string=} typeExtension\n   */\n  prepareTemplate(template, elementName, typeExtension) {\n    if (template._prepared) {\n      return;\n    }\n    template._prepared = true;\n    template.name = elementName;\n    template.extends = typeExtension;\n    templateMap[elementName] = template;\n    let cssBuild = this._getCssBuild(template);\n    let cssText = this._gatherStyles(template);\n    let info = {\n      is: elementName,\n      extends: typeExtension,\n      __cssBuild: cssBuild,\n    };\n    if (!nativeShadow) {\n      StyleTransformer.dom(template.content, elementName);\n    }\n    // check if the styling has mixin definitions or uses\n    this._ensure();\n    let hasMixins = detectMixin(cssText)\n    let ast = parse(cssText);\n    // only run the applyshim transforms if there is a mixin involved\n    if (hasMixins && nativeCssVariables && this._applyShim) {\n      this._applyShim['transformRules'](ast, elementName);\n    }\n    template['_styleAst'] = ast;\n    template._cssBuild = cssBuild;\n\n    let ownPropertyNames = [];\n    if (!nativeCssVariables) {\n      ownPropertyNames = StyleProperties.decorateStyles(template['_styleAst']);\n    }\n    if (!ownPropertyNames.length || nativeCssVariables) {\n      let root = nativeShadow ? template.content : null;\n      let placeholder = placeholderMap[elementName];\n      let style = this._generateStaticStyle(info, template['_styleAst'], root, placeholder);\n      template._style = style;\n    }\n    template._ownPropertyNames = ownPropertyNames;\n  }\n  _generateStaticStyle(info, rules, shadowroot, placeholder) {\n    let cssText = StyleTransformer.elementStyles(info, rules);\n    if (cssText.length) {\n      return StyleUtil.applyCss(cssText, info.is, shadowroot, placeholder);\n    }\n  }\n  _prepareHost(host) {\n    let {is, typeExtension} = StyleUtil.getIsExtends(host);\n    let placeholder = placeholderMap[is];\n    let template = templateMap[is];\n    let ast;\n    let ownStylePropertyNames;\n    let cssBuild;\n    if (template) {\n      ast = template['_styleAst'];\n      ownStylePropertyNames = template._ownPropertyNames;\n      cssBuild = template._cssBuild;\n    }\n    return StyleInfo.set(host,\n      new StyleInfo(\n        ast,\n        placeholder,\n        ownStylePropertyNames,\n        is,\n        typeExtension,\n        cssBuild\n      )\n    );\n  }\n  _ensureApplyShim() {\n    if (this._applyShim) {\n      return;\n    } else if (window.ShadyCSS && window.ShadyCSS.ApplyShim) {\n      this._applyShim = window.ShadyCSS.ApplyShim;\n      this._applyShim['invalidCallback'] = ApplyShimUtils.invalidate;\n    }\n  }\n  _ensureCustomStyleInterface() {\n    if (this._customStyleInterface) {\n      return;\n    } else if (window.ShadyCSS && window.ShadyCSS.CustomStyleInterface) {\n      this._customStyleInterface = /** @type {!CustomStyleInterfaceInterface} */(window.ShadyCSS.CustomStyleInterface);\n      /** @type {function(!HTMLStyleElement)} */\n      this._customStyleInterface['transformCallback'] = (style) => {this.transformCustomStyleForDocument(style)};\n      this._customStyleInterface['validateCallback'] = () => {\n        requestAnimationFrame(() => {\n          if (this._customStyleInterface['enqueued'] || this._elementsHaveApplied) {\n            this.flushCustomStyles();\n          }\n        })\n      };\n    }\n  }\n  _ensure() {\n    this._ensureApplyShim();\n    this._ensureCustomStyleInterface();\n  }\n  /**\n   * Flush and apply custom styles to document\n   */\n  flushCustomStyles() {\n    this._ensure();\n    if (!this._customStyleInterface) {\n      return;\n    }\n    let customStyles = this._customStyleInterface['processStyles']();\n    // early return if custom-styles don't need validation\n    if (!this._customStyleInterface['enqueued']) {\n      return;\n    }\n    if (!nativeCssVariables) {\n      this._updateProperties(this._documentOwner, this._documentOwnerStyleInfo);\n      this._applyCustomStyles(customStyles);\n    } else {\n      this._revalidateCustomStyleApplyShim(customStyles);\n    }\n    this._customStyleInterface['enqueued'] = false;\n    // if custom elements have upgraded and there are no native css variables, we must recalculate the whole tree\n    if (this._elementsHaveApplied && !nativeCssVariables) {\n      this.styleDocument();\n    }\n  }\n  /**\n   * Apply styles for the given element\n   *\n   * @param {!HTMLElement} host\n   * @param {Object=} overrideProps\n   */\n  styleElement(host, overrideProps) {\n    let {is} = StyleUtil.getIsExtends(host);\n    let styleInfo = StyleInfo.get(host);\n    if (!styleInfo) {\n      styleInfo = this._prepareHost(host);\n    }\n    // Only trip the `elementsHaveApplied` flag if a node other that the root document has `applyStyle` called\n    if (!this._isRootOwner(host)) {\n      this._elementsHaveApplied = true;\n    }\n    if (overrideProps) {\n      styleInfo.overrideStyleProperties =\n        styleInfo.overrideStyleProperties || {};\n      Object.assign(styleInfo.overrideStyleProperties, overrideProps);\n    }\n    if (!nativeCssVariables) {\n     this._updateProperties(host, styleInfo);\n      if (styleInfo.ownStylePropertyNames && styleInfo.ownStylePropertyNames.length) {\n        this._applyStyleProperties(host, styleInfo);\n      }\n    } else {\n      if (styleInfo.overrideStyleProperties) {\n        updateNativeProperties(host, styleInfo.overrideStyleProperties);\n      }\n      let template = templateMap[is];\n      // bail early if there is no shadowroot for this element\n      if (!template && !this._isRootOwner(host)) {\n        return;\n      }\n      if (template && template._style && !ApplyShimUtils.templateIsValid(template)) {\n        // update template\n        if (!ApplyShimUtils.templateIsValidating(template)) {\n          this._ensure();\n          this._applyShim && this._applyShim['transformRules'](template['_styleAst'], is);\n          template._style.textContent = StyleTransformer.elementStyles(host, styleInfo.styleRules);\n          ApplyShimUtils.startValidatingTemplate(template);\n        }\n        // update instance if native shadowdom\n        if (nativeShadow) {\n          let root = host.shadowRoot;\n          if (root) {\n            let style = root.querySelector('style');\n            style.textContent = StyleTransformer.elementStyles(host, styleInfo.styleRules);\n          }\n        }\n        styleInfo.styleRules = template['_styleAst'];\n      }\n    }\n  }\n  _styleOwnerForNode(node) {\n    let root = node.getRootNode();\n    let host = root.host;\n    if (host) {\n      if (StyleInfo.get(host)) {\n        return host;\n      } else {\n        return this._styleOwnerForNode(host);\n      }\n    }\n    return this._documentOwner;\n  }\n  _isRootOwner(node) {\n    return (node === this._documentOwner);\n  }\n  _applyStyleProperties(host, styleInfo) {\n    let is = StyleUtil.getIsExtends(host).is;\n    let cacheEntry = styleCache.fetch(is, styleInfo.styleProperties, styleInfo.ownStylePropertyNames);\n    let cachedScopeSelector = cacheEntry && cacheEntry.scopeSelector;\n    let cachedStyle = cacheEntry ? cacheEntry.styleElement : null;\n    let oldScopeSelector = styleInfo.scopeSelector;\n    // only generate new scope if cached style is not found\n    styleInfo.scopeSelector = cachedScopeSelector || this._generateScopeSelector(is);\n    let style = StyleProperties.applyElementStyle(host, styleInfo.styleProperties, styleInfo.scopeSelector, cachedStyle);\n    if (!nativeShadow) {\n      StyleProperties.applyElementScopeSelector(host, styleInfo.scopeSelector, oldScopeSelector);\n    }\n    if (!cacheEntry) {\n      styleCache.store(is, styleInfo.styleProperties, style, styleInfo.scopeSelector);\n    }\n    return style;\n  }\n  _updateProperties(host, styleInfo) {\n    let owner = this._styleOwnerForNode(host);\n    let ownerStyleInfo = StyleInfo.get(owner);\n    let ownerProperties = ownerStyleInfo.styleProperties;\n    let props = Object.create(ownerProperties || null);\n    let hostAndRootProps = StyleProperties.hostAndRootPropertiesForScope(host, styleInfo.styleRules);\n    let propertyData = StyleProperties.propertyDataFromStyles(ownerStyleInfo.styleRules, host);\n    let propertiesMatchingHost = propertyData.properties\n    Object.assign(\n      props,\n      hostAndRootProps.hostProps,\n      propertiesMatchingHost,\n      hostAndRootProps.rootProps\n    );\n    this._mixinOverrideStyles(props, styleInfo.overrideStyleProperties);\n    StyleProperties.reify(props);\n    styleInfo.styleProperties = props;\n  }\n  _mixinOverrideStyles(props, overrides) {\n    for (let p in overrides) {\n      let v = overrides[p];\n      // skip override props if they are not truthy or 0\n      // in order to fall back to inherited values\n      if (v || v === 0) {\n        props[p] = v;\n      }\n    }\n  }\n  /**\n   * Update styles of the whole document\n   *\n   * @param {Object=} properties\n   */\n  styleDocument(properties) {\n    this.styleSubtree(this._documentOwner, properties);\n  }\n  /**\n   * Update styles of a subtree\n   *\n   * @param {!HTMLElement} host\n   * @param {Object=} properties\n   */\n  styleSubtree(host, properties) {\n    let root = host.shadowRoot;\n    if (root || this._isRootOwner(host)) {\n      this.styleElement(host, properties);\n    }\n    // process the shadowdom children of `host`\n    let shadowChildren = root && (root.children || root.childNodes);\n    if (shadowChildren) {\n      for (let i = 0; i < shadowChildren.length; i++) {\n        let c = /** @type {!HTMLElement} */(shadowChildren[i]);\n        this.styleSubtree(c);\n      }\n    } else {\n      // process the lightdom children of `host`\n      let children = host.children || host.childNodes;\n      if (children) {\n        for (let i = 0; i < children.length; i++) {\n          let c = /** @type {!HTMLElement} */(children[i]);\n          this.styleSubtree(c);\n        }\n      }\n    }\n  }\n  /* Custom Style operations */\n  _revalidateCustomStyleApplyShim(customStyles) {\n    for (let i = 0; i < customStyles.length; i++) {\n      let c = customStyles[i];\n      let s = this._customStyleInterface['getStyleForCustomStyle'](c);\n      if (s) {\n        this._revalidateApplyShim(s);\n      }\n    }\n  }\n  _applyCustomStyles(customStyles) {\n    for (let i = 0; i < customStyles.length; i++) {\n      let c = customStyles[i];\n      let s = this._customStyleInterface['getStyleForCustomStyle'](c);\n      if (s) {\n        StyleProperties.applyCustomStyle(s, this._documentOwnerStyleInfo.styleProperties);\n      }\n    }\n  }\n  transformCustomStyleForDocument(style) {\n    let ast = StyleUtil.rulesForStyle(style);\n    StyleUtil.forEachRule(ast, (rule) => {\n      if (nativeShadow) {\n        StyleTransformer.normalizeRootSelector(rule);\n      } else {\n        StyleTransformer.documentRule(rule);\n      }\n      if (nativeCssVariables) {\n        this._ensure();\n        this._applyShim && this._applyShim['transformRule'](rule);\n      }\n    });\n    if (nativeCssVariables) {\n      style.textContent = StyleUtil.toCssText(ast);\n    } else {\n      this._documentOwnerStyleInfo.styleRules['rules'].push(ast);\n    }\n  }\n  _revalidateApplyShim(style) {\n    if (nativeCssVariables && this._applyShim) {\n      let ast = StyleUtil.rulesForStyle(style);\n      this._ensure();\n      this._applyShim['transformRules'](ast);\n      style.textContent = StyleUtil.toCssText(ast);\n    }\n  }\n  getComputedStyleValue(element, property) {\n    let value;\n    if (!nativeCssVariables) {\n      // element is either a style host, or an ancestor of a style host\n      let styleInfo = StyleInfo.get(element) || StyleInfo.get(this._styleOwnerForNode(element));\n      value = styleInfo.styleProperties[property];\n    }\n    // fall back to the property value from the computed styling\n    value = value || window.getComputedStyle(element).getPropertyValue(property);\n    // trim whitespace that can come after the `:` in css\n    // example: padding: 2px -> \" 2px\"\n    return value ? value.trim() : '';\n  }\n  // given an element and a classString, replaces\n  // the element's class with the provided classString and adds\n  // any necessary ShadyCSS static and property based scoping selectors\n  setElementClass(element, classString) {\n    let root = element.getRootNode();\n    let classes = classString ? classString.split(/\\s/) : [];\n    let scopeName = root.host && root.host.localName;\n    // If no scope, try to discover scope name from existing class.\n    // This can occur if, for example, a template stamped element that\n    // has been scoped is manipulated when not in a root.\n    if (!scopeName) {\n      var classAttr = element.getAttribute('class');\n      if (classAttr) {\n        let k$ = classAttr.split(/\\s/);\n        for (let i=0; i < k$.length; i++) {\n          if (k$[i] === StyleTransformer.SCOPE_NAME) {\n            scopeName = k$[i+1];\n            break;\n          }\n        }\n      }\n    }\n    if (scopeName) {\n      classes.push(StyleTransformer.SCOPE_NAME, scopeName);\n    }\n    if (!nativeCssVariables) {\n      let styleInfo = StyleInfo.get(element);\n      if (styleInfo && styleInfo.scopeSelector) {\n        classes.push(StyleProperties.XSCOPE_NAME, styleInfo.scopeSelector);\n      }\n    }\n    StyleUtil.setElementClassRaw(element, classes.join(' '));\n  }\n  _styleInfoForNode(node) {\n    return StyleInfo.get(node);\n  }\n}\n\n/* exports */\nScopingShim.prototype['flush'] = ScopingShim.prototype.flush;\nScopingShim.prototype['prepareTemplate'] = ScopingShim.prototype.prepareTemplate;\nScopingShim.prototype['styleElement'] = ScopingShim.prototype.styleElement;\nScopingShim.prototype['styleDocument'] = ScopingShim.prototype.styleDocument;\nScopingShim.prototype['styleSubtree'] = ScopingShim.prototype.styleSubtree;\nScopingShim.prototype['getComputedStyleValue'] = ScopingShim.prototype.getComputedStyleValue;\nScopingShim.prototype['setElementClass'] = ScopingShim.prototype.setElementClass;\nScopingShim.prototype['_styleInfoForNode'] = ScopingShim.prototype._styleInfoForNode;\nScopingShim.prototype['transformCustomStyleForDocument'] = ScopingShim.prototype.transformCustomStyleForDocument;\nScopingShim.prototype['getStyleAst'] = ScopingShim.prototype.getStyleAst;\nScopingShim.prototype['styleAstToString'] = ScopingShim.prototype.styleAstToString;\nScopingShim.prototype['flushCustomStyles'] = ScopingShim.prototype.flushCustomStyles;\nObject.defineProperties(ScopingShim.prototype, {\n  'nativeShadow': {\n    get() {\n      return nativeShadow;\n    }\n  },\n  'nativeCss': {\n    get() {\n      return nativeCssVariables;\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 { 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'use strict';\n\nimport ScopingShim from '../src/scoping-shim.js';\nimport {nativeCssVariables, nativeShadow} from '../src/style-settings.js';\n\n/** @const {ScopingShim} */\nconst scopingShim = new ScopingShim();\n\nlet ApplyShim, CustomStyleInterface;\n\nif (window['ShadyCSS']) {\n  ApplyShim = window['ShadyCSS']['ApplyShim'];\n  CustomStyleInterface = window['ShadyCSS']['CustomStyleInterface'];\n}\n\nwindow.ShadyCSS = {\n  ScopingShim: scopingShim,\n  /**\n   * @param {!HTMLTemplateElement} template\n   * @param {string} elementName\n   * @param {string=} elementExtends\n   */\n  prepareTemplate(template, elementName, elementExtends) {\n    scopingShim.flushCustomStyles();\n    scopingShim.prepareTemplate(template, elementName, elementExtends)\n  },\n\n  /**\n   * @param {!HTMLElement} element\n   * @param {Object=} properties\n   */\n  styleSubtree(element, properties) {\n    scopingShim.flushCustomStyles();\n    scopingShim.styleSubtree(element, properties);\n  },\n\n  /**\n   * @param {!HTMLElement} element\n   */\n  styleElement(element) {\n    scopingShim.flushCustomStyles();\n    scopingShim.styleElement(element);\n  },\n\n  /**\n   * @param {Object=} properties\n   */\n  styleDocument(properties) {\n    scopingShim.flushCustomStyles();\n    scopingShim.styleDocument(properties);\n  },\n\n  /**\n   * @param {Element} element\n   * @param {string} property\n   * @return {string}\n   */\n  getComputedStyleValue(element, property) {\n    return scopingShim.getComputedStyleValue(element, property);\n  },\n\n  nativeCss: nativeCssVariables,\n\n  nativeShadow: nativeShadow\n};\n\nif (ApplyShim) {\n  window.ShadyCSS.ApplyShim = ApplyShim;\n}\n\nif (CustomStyleInterface) {\n  window.ShadyCSS.CustomStyleInterface = CustomStyleInterface;\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'use strict';\n\n/*\n * Polyfills loaded: Custom Elements, Shady DOM/Shady CSS\n * Used in: Safari 9, Firefox, Edge\n */\n\nimport '../node_modules/@webcomponents/shadydom/src/shadydom.js';\nimport '../node_modules/@webcomponents/custom-elements/src/custom-elements.js';\nimport '../node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js';\n\nlet document = window.document;\n// global for (1) existence means `WebComponentsReady` will file,\n// (2) WebComponents.ready == true means event has fired.\nwindow.WebComponents = window.WebComponents || {};\n\nfunction fire() {\n  requestAnimationFrame(() => {\n    window.WebComponents.ready = true;\n    window.document.dispatchEvent(new CustomEvent('WebComponentsReady', { bubbles: true }));\n  })\n}\n\nfunction wait() {\n  fire();\n  document.removeEventListener('readystatechange', wait);\n}\n\nif (document.readyState !== 'loading') {\n  fire();\n} else {\n  document.addEventListener('readystatechange', wait);\n}"]}