mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
Simple builds for now, will advanced compile later Mark built files as binary to hide generated changes
193 lines
80 KiB
JavaScript
193 lines
80 KiB
JavaScript
(function(){
|
|
'use strict';var aa={scope:{},getGlobal:function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a}};aa.global=aa.getGlobal(this);var k={},ba=new Set("annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" "));function ca(a,b){for(;b&&b!==a&&!b.nextSibling;)b=b.parentNode;return b&&b!==a?b.nextSibling:null}
|
|
function da(a,b,c){c=void 0===c?new Set:c;for(var d=a;d;){if(d.nodeType===Node.ELEMENT_NODE){var e=d;b(e);var f=e.localName;if("link"===f&&"import"===e.getAttribute("rel")){d=e.import;if(d instanceof Node&&!c.has(d))for(c.add(d),d=d.firstChild;d;d=d.nextSibling)da(d,b,c);d=ca(a,e);continue}else if("template"===f){d=ca(a,e);continue}if(e=e.__CE_shadowRoot)for(e=e.firstChild;e;e=e.nextSibling)da(e,b,c)}d=d.firstChild?d.firstChild:ca(a,d)}}
|
|
k.isValidCustomElementName=function(a){var b=ba.has(a);a=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(a);return!b&&a};k.isConnected=function(a){var b=a.isConnected;if(void 0!==b)return b;for(;a&&!(a.__CE_isImportDocument||a instanceof Document);)a=a.parentNode||(window.ShadowRoot&&a instanceof ShadowRoot?a.host:void 0);return!(!a||!(a.__CE_isImportDocument||a instanceof Document))};k.walkDeepDescendantElements=da;k.setPropertyUnchecked=function(a,b,c){a[b]=c};var m={default:{custom:1,failed:2}};var ea={};function n(){this._localNameToDefinition=new Map;this._constructorToDefinition=new Map;this._patches=[];this._hasPatches=!1}n.prototype.setDefinition=function(a,b){this._localNameToDefinition.set(a,b);this._constructorToDefinition.set(b.constructor,b)};n.prototype.localNameToDefinition=function(a){return this._localNameToDefinition.get(a)};n.prototype.constructorToDefinition=function(a){return this._constructorToDefinition.get(a)};n.prototype.addPatch=function(a){this._hasPatches=!0;this._patches.push(a)};
|
|
n.prototype.patchTree=function(a){var b=this;this._hasPatches&&k.walkDeepDescendantElements(a,function(a){return b.patch(a)})};n.prototype.patch=function(a){if(this._hasPatches&&!a.__CE_patched){a.__CE_patched=!0;for(var b=0;b<this._patches.length;b++)this._patches[b](a)}};n.prototype.connectTree=function(a){var b=[];k.walkDeepDescendantElements(a,function(a){return b.push(a)});for(a=0;a<b.length;a++){var c=b[a];c.__CE_state===m.default.custom?this.connectedCallback(c):this.upgradeElement(c)}};
|
|
n.prototype.disconnectTree=function(a){var b=[];k.walkDeepDescendantElements(a,function(a){return b.push(a)});for(a=0;a<b.length;a++){var c=b[a];c.__CE_state===m.default.custom&&this.disconnectedCallback(c)}};
|
|
n.prototype.patchAndUpgradeTree=function(a,b){b=void 0===b?new Set:b;var c=this,d=[];k.walkDeepDescendantElements(a,function(a){if("link"===a.localName&&"import"===a.getAttribute("rel")){var e=a.import;e instanceof Node&&"complete"===e.readyState?(e.__CE_isImportDocument=!0,e.__CE_hasRegistry=!0):a.addEventListener("load",function(){var d=a.import;d.__CE_documentLoadHandled||(d.__CE_documentLoadHandled=!0,d.__CE_isImportDocument=!0,d.__CE_hasRegistry=!0,new Set(b),b.delete(d),c.patchAndUpgradeTree(d,
|
|
b))})}else d.push(a)},b);if(this._hasPatches)for(a=0;a<d.length;a++)this.patch(d[a]);for(a=0;a<d.length;a++)this.upgradeElement(d[a])};
|
|
n.prototype.upgradeElement=function(a){if(void 0===a.__CE_state){var b=this.localNameToDefinition(a.localName);if(b){b.constructionStack.push(a);var c=b.constructor;try{try{if(new c!==a)throw Error("The custom element constructor did not produce the element being upgraded.");}finally{b.constructionStack.pop()}}catch(f){throw a.__CE_state=m.default.failed,f;}a.__CE_state=m.default.custom;a.__CE_definition=b;if(b.attributeChangedCallback)for(b=b.observedAttributes,c=0;c<b.length;c++){var d=b[c],e=a.getAttribute(d);
|
|
null!==e&&this.attributeChangedCallback(a,d,null,e,null)}k.isConnected(a)&&this.connectedCallback(a)}}};n.prototype.connectedCallback=function(a){var b=a.__CE_definition;b.connectedCallback&&b.connectedCallback.call(a)};n.prototype.disconnectedCallback=function(a){var b=a.__CE_definition;b.disconnectedCallback&&b.disconnectedCallback.call(a)};
|
|
n.prototype.attributeChangedCallback=function(a,b,c,d,e){var f=a.__CE_definition;f.attributeChangedCallback&&-1<f.observedAttributes.indexOf(b)&&f.attributeChangedCallback.call(a,b,c,d,e)};ea.default=n;var fa={};function ga(a,b){this._internals=a;this._document=b;this._observer=void 0;this._internals.patchAndUpgradeTree(this._document);"loading"===this._document.readyState&&(this._observer=new MutationObserver(this._handleMutations.bind(this)),this._observer.observe(this._document,{childList:!0,subtree:!0}))}ga.prototype.disconnect=function(){this._observer&&this._observer.disconnect()};
|
|
ga.prototype._handleMutations=function(a){var b=this._document.readyState;"interactive"!==b&&"complete"!==b||this.disconnect();for(b=0;b<a.length;b++)for(var c=a[b].addedNodes,d=0;d<c.length;d++)this._internals.patchAndUpgradeTree(c[d])};fa.default=ga;var ha={};function ia(){var a=this;this._resolve=this._value=void 0;this._promise=new Promise(function(b){a._resolve=b;a._value&&b(a._value)})}ia.prototype.resolve=function(a){if(this._value)throw Error("Already resolved.");this._value=a;this._resolve&&this._resolve(a)};ia.prototype.toPromise=function(){return this._promise};ha.default=ia;var ja={};function p(a){this._elementDefinitionIsRunning=!1;this._internals=a;this._whenDefinedDeferred=new Map;this._flushCallback=function(a){return a()};this._flushPending=!1;this._unflushedLocalNames=[];this._documentConstructionObserver=new fa.default(a,document)}
|
|
p.prototype.define=function(a,b){var c=this;if(!(b instanceof Function))throw new TypeError("Custom element constructors must be functions.");if(!k.isValidCustomElementName(a))throw new SyntaxError("The element name '"+a+"' is not valid.");if(this._internals.localNameToDefinition(a))throw Error("A custom element with name '"+a+"' has already been defined.");if(this._elementDefinitionIsRunning)throw Error("A custom element is already being defined.");this._elementDefinitionIsRunning=!0;var d,e,f,g,
|
|
h;try{var l=function(a){var b=J[a];if(void 0!==b&&!(b instanceof Function))throw Error("The '"+a+"' callback must be a function.");return b},J=b.prototype;if(!(J instanceof Object))throw new TypeError("The custom element constructor's prototype is not an object.");d=l("connectedCallback");e=l("disconnectedCallback");f=l("adoptedCallback");g=l("attributeChangedCallback");h=b.observedAttributes||[]}catch(P){return}finally{this._elementDefinitionIsRunning=!1}this._internals.setDefinition(a,{localName:a,
|
|
constructor:b,connectedCallback:d,disconnectedCallback:e,adoptedCallback:f,attributeChangedCallback:g,observedAttributes:h,constructionStack:[]});this._unflushedLocalNames.push(a);this._flushPending||(this._flushPending=!0,this._flushCallback(function(){return c._flush()}))};
|
|
p.prototype._flush=function(){if(!1!==this._flushPending)for(this._flushPending=!1,this._internals.patchAndUpgradeTree(document);0<this._unflushedLocalNames.length;){var a=this._unflushedLocalNames.shift();(a=this._whenDefinedDeferred.get(a))&&a.resolve(void 0)}};p.prototype.get=function(a){if(a=this._internals.localNameToDefinition(a))return a.constructor};
|
|
p.prototype.whenDefined=function(a){if(!k.isValidCustomElementName(a))return Promise.reject(new SyntaxError("'"+a+"' is not a valid custom element name."));var b=this._whenDefinedDeferred.get(a);if(b)return b.toPromise();b=new ha.default;this._whenDefinedDeferred.set(a,b);this._internals.localNameToDefinition(a)&&-1===this._unflushedLocalNames.indexOf(a)&&b.resolve(void 0);return b.toPromise()};
|
|
p.prototype.polyfillWrapFlushCallback=function(a){this._documentConstructionObserver.disconnect();var b=this._flushCallback;this._flushCallback=function(c){return a(function(){return b(c)})}};window.CustomElementRegistry=p;p.prototype.define=p.prototype.define;p.prototype.get=p.prototype.get;p.prototype.whenDefined=p.prototype.whenDefined;p.prototype.polyfillWrapFlushCallback=p.prototype.polyfillWrapFlushCallback;ja.default=p;var q={},ka={Document_createElement:window.Document.prototype.createElement,Document_createElementNS:window.Document.prototype.createElementNS,Document_importNode:window.Document.prototype.importNode,Document_prepend:window.Document.prototype.prepend,Document_append:window.Document.prototype.append,Node_cloneNode:window.Node.prototype.cloneNode,Node_appendChild:window.Node.prototype.appendChild,Node_insertBefore:window.Node.prototype.insertBefore,Node_removeChild:window.Node.prototype.removeChild,
|
|
Node_replaceChild:window.Node.prototype.replaceChild,Node_textContent:Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),Element_attachShadow:window.Element.prototype.attachShadow,Element_innerHTML:Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),Element_getAttribute:window.Element.prototype.getAttribute,Element_setAttribute:window.Element.prototype.setAttribute,Element_removeAttribute:window.Element.prototype.removeAttribute,Element_getAttributeNS:window.Element.prototype.getAttributeNS,
|
|
Element_setAttributeNS:window.Element.prototype.setAttributeNS,Element_removeAttributeNS:window.Element.prototype.removeAttributeNS,Element_insertAdjacentElement:window.Element.prototype.insertAdjacentElement,Element_prepend:window.Element.prototype.prepend,Element_append:window.Element.prototype.append,Element_before:window.Element.prototype.before,Element_after:window.Element.prototype.after,Element_replaceWith:window.Element.prototype.replaceWith,Element_remove:window.Element.prototype.remove,
|
|
HTMLElement:window.HTMLElement,HTMLElement_innerHTML:Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),HTMLElement_insertAdjacentElement:window.HTMLElement.prototype.insertAdjacentElement};q.default=ka;var la={},ma=new function(){};la.default=ma;var na={default:function(a){window.HTMLElement=function(){function b(){var b=this.constructor,d=a.constructorToDefinition(b);if(!d)throw Error("The custom element being constructed was not registered with `customElements`.");var e=d.constructionStack;if(0===e.length)return e=q.default.Document_createElement.call(document,d.localName),Object.setPrototypeOf(e,b.prototype),e.__CE_state=m.default.custom,e.__CE_definition=d,a.patch(e),e;var d=e.length-1,f=e[d];if(f===la.default)throw Error("The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.");
|
|
e[d]=la.default;Object.setPrototypeOf(f,b.prototype);a.patch(f);return f}b.prototype=q.default.HTMLElement.prototype;return b}()}};var oa={default:function(a,b,c){b.prepend=function(b){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];f=d.filter(function(a){return a instanceof Node&&k.isConnected(a)});c.prepend.apply(this,d);for(var g=0;g<f.length;g++)a.disconnectTree(f[g]);if(k.isConnected(this))for(f=0;f<d.length;f++)g=d[f],g instanceof Element&&a.connectTree(g)};b.append=function(b){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];f=d.filter(function(a){return a instanceof Node&&k.isConnected(a)});c.append.apply(this,
|
|
d);for(var g=0;g<f.length;g++)a.disconnectTree(f[g]);if(k.isConnected(this))for(f=0;f<d.length;f++)g=d[f],g instanceof Element&&a.connectTree(g)}}};var pa={default:function(a){k.setPropertyUnchecked(Document.prototype,"createElement",function(b){if(this.__CE_hasRegistry){var c=a.localNameToDefinition(b);if(c)return new c.constructor}b=q.default.Document_createElement.call(this,b);a.patch(b);return b});k.setPropertyUnchecked(Document.prototype,"importNode",function(b,c){b=q.default.Document_importNode.call(this,b,c);this.__CE_hasRegistry?a.patchAndUpgradeTree(b):a.patchTree(b);return b});k.setPropertyUnchecked(Document.prototype,"createElementNS",
|
|
function(b,c){if(this.__CE_hasRegistry&&(null===b||"http://www.w3.org/1999/xhtml"===b)){var d=a.localNameToDefinition(c);if(d)return new d.constructor}b=q.default.Document_createElementNS.call(this,b,c);a.patch(b);return b});oa.default(a,Document.prototype,{prepend:q.default.Document_prepend,append:q.default.Document_append})}};var qa={default:function(a){function b(b,d){Object.defineProperty(b,"textContent",{enumerable:d.enumerable,configurable:!0,get:d.get,set:function(b){if(this.nodeType===Node.TEXT_NODE)d.set.call(this,b);else{var c=void 0;if(this.firstChild){var e=this.childNodes,h=e.length;if(0<h&&k.isConnected(this))for(var c=Array(h),l=0;l<h;l++)c[l]=e[l]}d.set.call(this,b);if(c)for(b=0;b<c.length;b++)a.disconnectTree(c[b])}}})}k.setPropertyUnchecked(Node.prototype,"insertBefore",function(b,d){if(b instanceof DocumentFragment){var c=
|
|
Array.prototype.slice.apply(b.childNodes);b=q.default.Node_insertBefore.call(this,b,d);if(k.isConnected(this))for(d=0;d<c.length;d++)a.connectTree(c[d]);return b}c=k.isConnected(b);d=q.default.Node_insertBefore.call(this,b,d);c&&a.disconnectTree(b);k.isConnected(this)&&a.connectTree(b);return d});k.setPropertyUnchecked(Node.prototype,"appendChild",function(b){if(b instanceof DocumentFragment){var c=Array.prototype.slice.apply(b.childNodes);b=q.default.Node_appendChild.call(this,b);if(k.isConnected(this))for(var e=
|
|
0;e<c.length;e++)a.connectTree(c[e]);return b}c=k.isConnected(b);e=q.default.Node_appendChild.call(this,b);c&&a.disconnectTree(b);k.isConnected(this)&&a.connectTree(b);return e});k.setPropertyUnchecked(Node.prototype,"cloneNode",function(b){b=q.default.Node_cloneNode.call(this,b);this.ownerDocument.__CE_hasRegistry?a.patchAndUpgradeTree(b):a.patchTree(b);return b});k.setPropertyUnchecked(Node.prototype,"removeChild",function(b){var c=k.isConnected(b),e=q.default.Node_removeChild.call(this,b);c&&a.disconnectTree(b);
|
|
return e});k.setPropertyUnchecked(Node.prototype,"replaceChild",function(b,d){if(b instanceof DocumentFragment){var c=Array.prototype.slice.apply(b.childNodes);b=q.default.Node_replaceChild.call(this,b,d);if(k.isConnected(this))for(a.disconnectTree(d),d=0;d<c.length;d++)a.connectTree(c[d]);return b}var c=k.isConnected(b),f=q.default.Node_replaceChild.call(this,b,d),g=k.isConnected(this);g&&a.disconnectTree(d);c&&a.disconnectTree(b);g&&a.connectTree(b);return f});q.default.Node_textContent&&q.default.Node_textContent.get?
|
|
b(Node.prototype,q.default.Node_textContent):a.addPatch(function(a){b(a,{enumerable:!0,configurable:!0,get:function(){for(var a=[],b=0;b<this.childNodes.length;b++)a.push(this.childNodes[b].textContent);return a.join("")},set:function(a){for(;this.firstChild;)q.default.Node_removeChild.call(this,this.firstChild);q.default.Node_appendChild.call(this,document.createTextNode(a))}})})}};var ra={default:function(a,b,c){b.before=function(b){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];f=d.filter(function(a){return a instanceof Node&&k.isConnected(a)});c.before.apply(this,d);for(var g=0;g<f.length;g++)a.disconnectTree(f[g]);if(k.isConnected(this))for(f=0;f<d.length;f++)g=d[f],g instanceof Element&&a.connectTree(g)};b.after=function(b){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];f=d.filter(function(a){return a instanceof Node&&k.isConnected(a)});c.after.apply(this,
|
|
d);for(var g=0;g<f.length;g++)a.disconnectTree(f[g]);if(k.isConnected(this))for(f=0;f<d.length;f++)g=d[f],g instanceof Element&&a.connectTree(g)};b.replaceWith=function(b){for(var d=[],f=0;f<arguments.length;++f)d[f-0]=arguments[f];var f=d.filter(function(a){return a instanceof Node&&k.isConnected(a)}),g=k.isConnected(this);c.replaceWith.apply(this,d);for(var h=0;h<f.length;h++)a.disconnectTree(f[h]);if(g)for(a.disconnectTree(this),f=0;f<d.length;f++)g=d[f],g instanceof Element&&a.connectTree(g)};
|
|
b.remove=function(){var b=k.isConnected(this);c.remove.call(this);b&&a.disconnectTree(this)}}};var sa={default:function(a){function b(b,c){Object.defineProperty(b,"innerHTML",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(b){var d=this,e=void 0;k.isConnected(this)&&(e=[],k.walkDeepDescendantElements(this,function(a){a!==d&&e.push(a)}));c.set.call(this,b);if(e)for(var f=0;f<e.length;f++){var g=e[f];g.__CE_state===m.default.custom&&a.disconnectedCallback(g)}this.ownerDocument.__CE_hasRegistry?a.patchAndUpgradeTree(this):a.patchTree(this);return b}})}function c(b,c){k.setPropertyUnchecked(b,
|
|
"insertAdjacentElement",function(b,d){var e=k.isConnected(d);b=c.call(this,b,d);e&&a.disconnectTree(d);k.isConnected(b)&&a.connectTree(d);return b})}q.default.Element_attachShadow?k.setPropertyUnchecked(Element.prototype,"attachShadow",function(a){return this.__CE_shadowRoot=a=q.default.Element_attachShadow.call(this,a)}):console.warn("Custom Elements: `Element#attachShadow` was not patched.");if(q.default.Element_innerHTML&&q.default.Element_innerHTML.get)b(Element.prototype,q.default.Element_innerHTML);
|
|
else if(q.default.HTMLElement_innerHTML&&q.default.HTMLElement_innerHTML.get)b(HTMLElement.prototype,q.default.HTMLElement_innerHTML);else{var d=q.default.Document_createElement.call(document,"div");a.addPatch(function(a){b(a,{enumerable:!0,configurable:!0,get:function(){return q.default.Node_cloneNode.call(this,!0).innerHTML},set:function(a){var b="template"===this.localName?this.content:this;for(d.innerHTML=a;0<b.childNodes.length;)q.default.Node_removeChild.call(b,b.childNodes[0]);for(;0<d.childNodes.length;)q.default.Node_appendChild.call(b,
|
|
d.childNodes[0])}})})}k.setPropertyUnchecked(Element.prototype,"setAttribute",function(b,c){if(this.__CE_state!==m.default.custom)return q.default.Element_setAttribute.call(this,b,c);var d=q.default.Element_getAttribute.call(this,b);q.default.Element_setAttribute.call(this,b,c);c=q.default.Element_getAttribute.call(this,b);d!==c&&a.attributeChangedCallback(this,b,d,c,null)});k.setPropertyUnchecked(Element.prototype,"setAttributeNS",function(b,c,d){if(this.__CE_state!==m.default.custom)return q.default.Element_setAttributeNS.call(this,
|
|
b,c,d);var e=q.default.Element_getAttributeNS.call(this,b,c);q.default.Element_setAttributeNS.call(this,b,c,d);d=q.default.Element_getAttributeNS.call(this,b,c);e!==d&&a.attributeChangedCallback(this,c,e,d,b)});k.setPropertyUnchecked(Element.prototype,"removeAttribute",function(b){if(this.__CE_state!==m.default.custom)return q.default.Element_removeAttribute.call(this,b);var c=q.default.Element_getAttribute.call(this,b);q.default.Element_removeAttribute.call(this,b);null!==c&&a.attributeChangedCallback(this,
|
|
b,c,null,null)});k.setPropertyUnchecked(Element.prototype,"removeAttributeNS",function(b,c){if(this.__CE_state!==m.default.custom)return q.default.Element_removeAttributeNS.call(this,b,c);var d=q.default.Element_getAttributeNS.call(this,b,c);q.default.Element_removeAttributeNS.call(this,b,c);var e=q.default.Element_getAttributeNS.call(this,b,c);d!==e&&a.attributeChangedCallback(this,c,d,e,b)});q.default.HTMLElement_insertAdjacentElement?c(HTMLElement.prototype,q.default.HTMLElement_insertAdjacentElement):
|
|
q.default.Element_insertAdjacentElement?c(Element.prototype,q.default.Element_insertAdjacentElement):console.warn("Custom Elements: `Element#insertAdjacentElement` was not patched.");oa.default(a,Element.prototype,{prepend:q.default.Element_prepend,append:q.default.Element_append});ra.default(a,Element.prototype,{before:q.default.Element_before,after:q.default.Element_after,replaceWith:q.default.Element_replaceWith,remove:q.default.Element_remove})}};/*
|
|
|
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
Code distributed by Google as part of the polymer project is also
|
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
*/
|
|
var ta=window.customElements;if(!ta||ta.forcePolyfill||"function"!=typeof ta.define||"function"!=typeof ta.get){var ua=new ea.default;na.default(ua);pa.default(ua);qa.default(ua);sa.default(ua);document.__CE_hasRegistry=!0;var va=new ja.default(ua);Object.defineProperty(window,"customElements",{configurable:!0,enumerable:!0,value:va})};/*
|
|
|
|
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
Code distributed by Google as part of the polymer project is also
|
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
*/
|
|
var r={},t=window.ShadyDOM||{};t.hasNativeShadowDOM=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var wa=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");t.hasDescriptors=!!(wa&&wa.configurable&&wa.get);t.inUse=t.force||!t.hasNativeShadowDOM;function xa(a){return"ShadyRoot"===a.__localName}var u=Element.prototype,ya=u.matches||u.matchesSelector||u.mozMatchesSelector||u.msMatchesSelector||u.oMatchesSelector||u.webkitMatchesSelector;
|
|
function Aa(a,b){if(a&&b)for(var c=Object.getOwnPropertyNames(b),d=0,e;d<c.length&&(e=c[d]);d++){var f=e,g=a,h=Object.getOwnPropertyDescriptor(b,f);h&&Object.defineProperty(g,f,h)}return a||b}var Ba=document.createTextNode(""),Ca=0,Da=[];(new MutationObserver(function(){for(;Da.length;)try{Da.shift()()}catch(a){throw Ba.textContent=Ca++,a;}})).observe(Ba,{characterData:!0});r.settings=t;r.isShadyRoot=xa;r.ownerShadyRootForNode=function(a){a=a.getRootNode();if(xa(a))return a};
|
|
r.matchesSelector=function(a,b){return ya.call(a,b)};r.extend=Aa;r.extendAll=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];for(d=0;d<c.length;d++)Aa(a,c[d]);return a};r.mixin=function(a,b){for(var c in b)a[c]=b[c];return a};r.patchPrototype=function(a,b){var c=Object.getPrototypeOf(a);if(!c.hasOwnProperty("__patchProto")){var d=Object.create(c);d.__sourceProto=c;Aa(d,b);c.__patchProto=d}a.__proto__=c.__patchProto};r.microtask=function(a){Da.push(a);Ba.textContent=Ca++};var Ea={},Fa=[],Ga;function Ha(){Ga=!1;for(var a=!!Fa.length;Fa.length;)Fa.shift()();return a}Ha.list=Fa;Ea.enqueue=function(a){Ga||(Ga=!0,r.microtask(Ha));Fa.push(a)};Ea.flush=Ha;var v={};function Ia(){this._scheduled=!1;this.addedNodes=[];this.removedNodes=[];this.callbacks=new Set}Ia.prototype.schedule=function(){var a=this;this._scheduled||(this._scheduled=!0,r.microtask(function(){a.flush()}))};Ia.prototype.flush=function(){if(this._scheduled){this._scheduled=!1;var a=this.takeRecords();a.length&&this.callbacks.forEach(function(b){b(a)})}};
|
|
Ia.prototype.takeRecords=function(){if(this.addedNodes.length||this.removedNodes.length){var a=[{addedNodes:this.addedNodes,removedNodes:this.removedNodes}];this.addedNodes=[];this.removedNodes=[];return a}return[]};v.observeChildren=function(a,b){a.__shady=a.__shady||{};a.__shady.observer||(a.__shady.observer=new Ia);a.__shady.observer.callbacks.add(b);var c=a.__shady.observer;return{_callback:b,_observer:c,_node:a,takeRecords:function(){return c.takeRecords()}}};
|
|
v.unobserveChildren=function(a){var b=a&&a._observer;b&&(b.callbacks.delete(a._callback),b.callbacks.size||(a._node.__shady.observer=null))};v.filterMutations=function(a,b){var c=b.getRootNode();return a.map(function(a){var b=c===a.target.getRootNode();if(b&&a.addedNodes){if(b=Array.from(a.addedNodes).filter(function(a){return c===a.getRootNode()}),b.length)return a=Object.create(a),Object.defineProperty(a,"addedNodes",{value:b,configurable:!0}),a}else if(b)return a}).filter(function(a){return a})};var w={},Ja=Element.prototype.insertBefore,Ka=Element.prototype.removeChild,La=Element.prototype.setAttribute,Ma=Element.prototype.removeAttribute,Na=Element.prototype.cloneNode,Oa=Document.prototype.importNode,Pa=Element.prototype.addEventListener,Qa=Element.prototype.removeEventListener;w.appendChild=Element.prototype.appendChild;w.insertBefore=Ja;w.removeChild=Ka;w.setAttribute=La;w.removeAttribute=Ma;w.cloneNode=Na;w.importNode=Oa;w.addEventListener=Pa;w.removeEventListener=Qa;var Ra={},Sa=/[&\u00A0"]/g,Ta=/[&\u00A0<>]/g;function Ua(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}}function Va(a){for(var b={},c=0;c<a.length;c++)b[a[c]]=!0;return b}var Wa=Va("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),Xa=Va("style script xmp iframe noembed noframes plaintext noscript".split(" "));
|
|
function Ya(a,b,c){switch(a.nodeType){case Node.ELEMENT_NODE:b=a.localName;for(var d="<"+b,e=a.attributes,f=0,g;g=e[f];f++)d+=" "+g.name+'="'+g.value.replace(Sa,Ua)+'"';d+=">";return Wa[b]?d:d+Za(a,c)+"</"+b+">";case Node.TEXT_NODE:return a=a.data,b&&Xa[b.localName]?a:a.replace(Ta,Ua);case Node.COMMENT_NODE:return"\x3c!--"+a.data+"--\x3e";default:throw window.console.error(a),Error("not implemented");}}
|
|
function Za(a,b){"template"===a.localName&&(a=a.content);for(var c="",d=b?b(a):a.childNodes,e=0,f=d.length,g;e<f&&(g=d[e]);e++)c+=Ya(g,a,b);return c}Ra.getOuterHTML=Ya;Ra.getInnerHTML=Za;var x={},y=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),z=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1);function $a(a){var b=[];y.currentNode=a;for(a=y.firstChild();a;)b.push(a),a=y.nextSibling();return b}x.parentNode=function(a){y.currentNode=a;return y.parentNode()};x.firstChild=function(a){y.currentNode=a;return y.firstChild()};x.lastChild=function(a){y.currentNode=a;return y.lastChild()};x.previousSibling=function(a){y.currentNode=a;return y.previousSibling()};
|
|
x.nextSibling=function(a){y.currentNode=a;return y.nextSibling()};x.childNodes=$a;x.parentElement=function(a){z.currentNode=a;return z.parentNode()};x.firstElementChild=function(a){z.currentNode=a;return z.firstChild()};x.lastElementChild=function(a){z.currentNode=a;return z.lastChild()};x.previousElementSibling=function(a){z.currentNode=a;return z.previousSibling()};x.nextElementSibling=function(a){z.currentNode=a;return z.nextSibling()};
|
|
x.children=function(a){var b=[];z.currentNode=a;for(a=z.firstChild();a;)b.push(a),a=z.nextSibling();return b};x.innerHTML=function(a){return Ra.getInnerHTML(a,function(a){return $a(a)})};x.textContent=function(a){if(a.nodeType!==Node.ELEMENT_NODE)return a.nodeValue;a=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1);for(var b="",c;c=a.nextNode();)b+=c.nodeValue;return b};var A={};function ab(a,b){return a.__shady&&a.__shady[b]}A.getProperty=ab;A.hasProperty=function(a,b){return void 0!==ab(a,b)};var B={};function C(a){return{get:function(){var b=A.getProperty(this,a);return void 0!==b?b:x[a](this)},configurable:!0}}
|
|
var bb=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML")||Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML"),cb=document.implementation.createHTMLDocument("inert").createElement("div"),db=Object.getOwnPropertyDescriptor(Document.prototype,"activeElement"),eb={parentElement:C("parentElement"),parentNode:C("parentNode"),nextSibling:C("nextSibling"),previousSibling:C("previousSibling"),className:{get:function(){return this.getAttribute("class")},set:function(a){this.setAttribute("class",
|
|
a)},configurable:!0},nextElementSibling:{get:function(){if(A.hasProperty(this,"nextSibling")){for(var a=this.nextSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}return x.nextElementSibling(this)},configurable:!0},previousElementSibling:{get:function(){if(A.hasProperty(this,"previousSibling")){for(var a=this.previousSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}return x.previousElementSibling(this)},configurable:!0}},fb={childNodes:{get:function(){if(A.hasProperty(this,
|
|
"firstChild")){if(!this.__shady.childNodes){this.__shady.childNodes=[];for(var a=this.firstChild;a;a=a.nextSibling)this.__shady.childNodes.push(a)}return this.__shady.childNodes}return x.childNodes(this)},configurable:!0},firstChild:C("firstChild"),lastChild:C("lastChild"),textContent:{get:function(){if(A.hasProperty(this,"firstChild")){for(var a=[],b=0,c=this.childNodes,d;d=c[b];b++)d.nodeType!==Node.COMMENT_NODE&&a.push(d.textContent);return a.join("")}return x.textContent(this)},set:function(a){if(this.nodeType!==
|
|
Node.ELEMENT_NODE)this.nodeValue=a;else{for(;this.firstChild;)this.removeChild(this.firstChild);a&&this.appendChild(document.createTextNode(a))}},configurable:!0},firstElementChild:{get:function(){if(A.hasProperty(this,"firstChild")){for(var a=this.firstChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}return x.firstElementChild(this)},configurable:!0},lastElementChild:{get:function(){if(A.hasProperty(this,"lastChild")){for(var a=this.lastChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=
|
|
a.previousSibling;return a}return x.lastElementChild(this)},configurable:!0},children:{get:function(){return A.hasProperty(this,"firstChild")?Array.prototype.filter.call(this.childNodes,function(a){return a.nodeType===Node.ELEMENT_NODE}):x.children(this)},configurable:!0},innerHTML:{get:function(){var a="template"===this.localName?this.content:this;return A.hasProperty(this,"firstChild")?Ra.getInnerHTML(a):x.innerHTML(a)},set:function(a){for(var b="template"===this.localName?this.content:this;b.firstChild;)b.removeChild(b.firstChild);
|
|
for(bb&&bb.set?bb.set.call(cb,a):cb.innerHTML=a;cb.firstChild;)b.appendChild(cb.firstChild)},configurable:!0}},gb={shadowRoot:{get:function(){return this.shadyRoot},set:function(a){this.shadyRoot=a},configurable:!0}},hb={activeElement:{get:function(){var a;a=db&&db.get?db.get.call(document):r.settings.hasDescriptors?void 0:document.activeElement;if(a&&a.nodeType){var b=!!r.isShadyRoot(this);if(this===document||b&&this.host!==a&&this.host.contains(a)){for(b=r.ownerShadyRootForNode(a);b&&b!==this;)a=
|
|
b.host,b=r.ownerShadyRootForNode(a);a=this===document?b?null:a:b===this?a:null}else a=null}else a=null;return a},set:function(){},configurable:!0}};function D(a,b,c){for(var d in b){var e=Object.getOwnPropertyDescriptor(a,d);e&&e.configurable||!e&&c?Object.defineProperty(a,d,b[d]):c&&console.warn("Could not define",d,"on",a)}}
|
|
var ib=r.settings.hasDescriptors?function(){}:function(a){a.__shady&&a.__shady.__outsideAccessors||(a.__shady=a.__shady||{},a.__shady.__outsideAccessors=!0,D(a,eb,!0))},jb=r.settings.hasDescriptors?function(){}:function(a){a.__shady&&a.__shady.__insideAccessors||(a.__shady=a.__shady||{},a.__shady.__insideAccessors=!0,D(a,fb,!0),D(a,gb,!0))};B.ShadowRootAccessor=gb;B.ActiveElementAccessor=hb;B.patchAccessors=function(a){D(a,eb);D(a,fb);D(a,hb)};
|
|
B.patchShadowRootAccessors=function(a){D(a,fb,!0);D(a,hb,!0)};B.patchOutsideElementAccessors=ib;B.patchInsideElementAccessors=jb;var E={};
|
|
function kb(a,b,c){B.patchOutsideElementAccessors(a);c=c||null;a.__shady=a.__shady||{};b.__shady=b.__shady||{};c&&(c.__shady=c.__shady||{});a.__shady.previousSibling=c?c.__shady.previousSibling:b.lastChild;var d=a.__shady.previousSibling;d&&d.__shady&&(d.__shady.nextSibling=a);(d=a.__shady.nextSibling=c)&&d.__shady&&(d.__shady.previousSibling=a);a.__shady.parentNode=b;c?c===b.__shady.firstChild&&(b.__shady.firstChild=a):(b.__shady.lastChild=a,b.__shady.firstChild||(b.__shady.firstChild=a));b.__shady.childNodes=
|
|
null}E.recordInsertBefore=function(a,b,c){B.patchInsideElementAccessors(b);b.__shady=b.__shady||{};A.hasProperty(b,"firstChild")&&(b.__shady.childNodes=null);if(a.nodeType===Node.DOCUMENT_FRAGMENT_NODE){for(var d=a.childNodes,e=0;e<d.length;e++)kb(d[e],b,c);a.__shady=a.__shady||{};b=A.hasProperty(a,"firstChild")?null:void 0;a.__shady.firstChild=a.__shady.lastChild=b;a.__shady.childNodes=b}else kb(a,b,c)};
|
|
E.recordRemoveChild=function(a,b){a.__shady=a.__shady||{};b.__shady=b.__shady||{};a===b.__shady.firstChild&&(b.__shady.firstChild=a.__shady.nextSibling);a===b.__shady.lastChild&&(b.__shady.lastChild=a.__shady.previousSibling);var c=a.__shady.previousSibling,d=a.__shady.nextSibling;c&&(c.__shady=c.__shady||{},c.__shady.nextSibling=d);d&&(d.__shady=d.__shady||{},d.__shady.previousSibling=c);a.__shady.parentNode=a.__shady.previousSibling=a.__shady.nextSibling=void 0;A.hasProperty(b,"childNodes")&&(b.__shady.childNodes=
|
|
null)};E.recordChildNodes=function(a){if(!A.hasProperty(a,"firstChild")){a.__shady=a.__shady||{};a.__shady.firstChild=x.firstChild(a);a.__shady.lastChild=x.lastChild(a);B.patchInsideElementAccessors(a);for(var b=a.__shady.childNodes=x.childNodes(a),c=0,d;c<b.length&&(d=b[c]);c++)d.__shady=d.__shady||{},d.__shady.parentNode=a,d.__shady.nextSibling=b[c+1]||null,d.__shady.previousSibling=b[c-1]||null,B.patchOutsideElementAccessors(d)}};var F={};
|
|
function lb(a){var b=A.hasProperty(a,"parentNode")&&A.getProperty(a,"parentNode"),c,d=r.ownerShadyRootForNode(a);if(b||d){c=mb(a);b&&E.recordRemoveChild(a,b);var e;if(e=d){var f;e=d._insertionPoints;for(var g=0;g<e.length;g++){var h=e[g],l;a:{for(l=h;l;){if(l==a){l=!0;break a}l=l.parentNode}l=void 0}if(l)for(h=h.assignedNodes({flatten:!0}),l=0;l<h.length;l++){f=!0;var J=h[l],P=x.parentNode(J);P&&w.removeChild.call(P,J)}}e=f}f=e;b=b&&d&&b.localName===d.getInsertionPointTag();if(f||b)d._skipUpdateInsertionPoints=!1,
|
|
nb(d)}ob(a);return c}function pb(a,b,c){if(a=a.__shady&&a.__shady.observer)b&&a.addedNodes.push(b),c&&a.removedNodes.push(c),a.schedule()}function qb(a){if(a&&a.nodeType){var b=a.__ownerShadyRoot;void 0===b&&(b=r.isShadyRoot(a)?a:(b=a.parentNode)?qb(b):a,document.documentElement.contains(a)&&(a.__ownerShadyRoot=b));return b}}
|
|
function rb(a,b,c){var d,e=c.getInsertionPointTag();if(a.nodeType!==Node.DOCUMENT_FRAGMENT_NODE||a.__noInsertionPoint)a.localName===e&&(E.recordChildNodes(b),E.recordChildNodes(a),d=!0);else for(var e=a.querySelectorAll(e),f=0,g,h;f<e.length&&(g=e[f]);f++)h=g.parentNode,h===a&&(h=b),h=rb(g,h,c),d=d||h;return d}function ob(a){if(void 0!==a.__ownerShadyRoot)for(var b=a.childNodes,c=0,d=b.length,e;c<d&&(e=b[c]);c++)ob(e);a.__ownerShadyRoot=void 0}
|
|
function mb(a){if((a=a.parentNode)&&a.shadyRoot&&a.shadyRoot.hasInsertionPoint())return nb(a.shadyRoot),!0}function nb(a){a._changePending=!0;a.update()}function sb(a,b){"slot"===b?mb(a):"slot"===a.localName&&"name"===b&&(a=r.ownerShadyRootForNode(a))&&a.update()}function tb(a,b,c,d){for(var e=0,f=a.length,g;e<f&&(g=a[e]);e++){var h;if(h=g.nodeType===Node.ELEMENT_NODE){h=g;var l=b,J=c,P=d,za=l(h);za&&P.push(h);J&&J(za)?h=za:(tb(h.childNodes,l,J,P),h=void 0)}if(h)return!0}}var ub=null;
|
|
function vb(a,b){if(a.ownerDocument!==document)return w.importNode.call(document,a,b);var c=w.importNode.call(document,a,!1);if(b){a=a.childNodes;b=0;for(var d;b<a.length;b++)d=vb(a[b],!0),c.appendChild(d)}return c}F.getRootNode=qb;F.query=function(a,b,c){var d=[];tb(a.childNodes,b,c,d);return d};F.renderRootNode=function(a){a=a.getRootNode();r.isShadyRoot(a)&&a.render()};
|
|
F.setAttribute=function(a,b,c){ub||(ub=window.ShadyCSS&&window.ShadyCSS.ScopingShim);ub&&"class"===b&&a.ownerDocument===document?ub.setElementClass(a,c):(w.setAttribute.call(a,b,c),sb(a,b))};F.removeAttribute=function(a,b){w.removeAttribute.call(a,b);sb(a,b)};
|
|
F.insertBefore=function(a,b,c){if(c){var d=A.getProperty(c,"parentNode");if(void 0!==d&&d!==a)throw Error("The ref_node to be inserted before is not a child of this node");}b.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&(d=A.getProperty(b,"parentNode"),d?(pb(d,null,b),lb(b)):(b.parentNode&&w.removeChild.call(b.parentNode,b),ob(b)));var e=c,d=r.ownerShadyRootForNode(a),f;d&&(b.__noInsertionPoint&&!d._changePending&&(d._skipUpdateInsertionPoints=!0),f=rb(b,a,d))&&(d._skipUpdateInsertionPoints=!1);A.hasProperty(a,
|
|
"firstChild")&&E.recordInsertBefore(b,a,e);var e=f,g=d&&d.getInsertionPointTag()||"",h=b.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&!b.__noInsertionPoint&&g&&b.querySelector(g);f=h&&h.parentNode.nodeType!==Node.DOCUMENT_FRAGMENT_NODE;((h=h||b.localName===g)||a.localName===g||e)&&d&&nb(d);(d=a&&a.shadyRoot&&a.shadyRoot.hasInsertionPoint())&&nb(a.shadyRoot);if(!(d||h&&!f||a.shadyRoot)){if(c&&(d=r.ownerShadyRootForNode(c))){var l;if(c.localName===d.getInsertionPointTag())a:{d=c.assignedNodes({flatten:!0});
|
|
f=qb(c);e=0;for(g=d.length;e<g&&(l=d[e]);e++)if(f.isFinalDestination(c,l))break a;l=void 0}else l=c;c=l}l=r.isShadyRoot(a)?a.host:a;c?w.insertBefore.call(l,b,c):w.appendChild.call(l,b)}pb(a,b);return b};F.removeChild=function(a,b){if(b.parentNode!==a)throw Error("The node to be removed is not a child of this node: "+b);if(!lb(b)){var c=r.isShadyRoot(a)?a.host:a,d=x.parentNode(b);c===d&&w.removeChild.call(c,b)}pb(a,null,b);return b};
|
|
F.cloneNode=function(a,b){if("template"==a.localName)return w.cloneNode.call(a,b);var c=w.cloneNode.call(a,!1);if(b){a=a.childNodes;b=0;for(var d;b<a.length;b++)d=a[b].cloneNode(!0),c.appendChild(d)}return c};F.importNode=vb;var G={},wb={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0,pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,
|
|
drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0};function xb(a,b){var c=[],d=a;for(a=a===window?window:a.getRootNode();d;)c.push(d),d=d.assignedSlot?d.assignedSlot:d.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&d.host&&(b||d!==a)?d.host:d.parentNode;c[c.length-1]===document&&c.push(window);return c}
|
|
function yb(a,b){if(!r.isShadyRoot)return a;a=xb(a,!0);for(var c=0,d,e,f,g;c<b.length;c++)if(d=b[c],f=d===window?window:d.getRootNode(),f!==e&&(g=a.indexOf(f),e=f),!r.isShadyRoot(f)||-1<g)return d}
|
|
var zb={get composed(){this.isTrusted&&void 0===this.__composed&&(this.__composed=wb[this.type]);return this.__composed||!1},composedPath:function(){this.__composedPath||(this.__composedPath=xb(this.__target,this.composed));return this.__composedPath},get target(){return yb(this.currentTarget,this.composedPath())},get relatedTarget(){if(!this.__relatedTarget)return null;this.__relatedTargetComposedPath||(this.__relatedTargetComposedPath=xb(this.__relatedTarget,!0));return yb(this.currentTarget,this.__relatedTargetComposedPath)},
|
|
stopPropagation:function(){Event.prototype.stopPropagation.call(this);this.__propagationStopped=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this);this.__propagationStopped=this.__immediatePropagationStopped=!0}};function Ab(a){function b(b,d){b=new a(b,d);b.__composed=d&&!!d.composed;return b}r.mixin(b,a);b.prototype=a.prototype;return b}var Bb={focus:!0,blur:!0};
|
|
function Cb(a,b,c){if(c=b.__handlers&&b.__handlers[a.type]&&b.__handlers[a.type][c])for(var d=0,e;(e=c[d])&&(e.call(b,a),!a.__immediatePropagationStopped);d++);}
|
|
function Db(a){var b=a.composedPath(),c;Object.defineProperty(a,"currentTarget",{get:function(){return c},configurable:!0});for(var d=b.length-1;0<=d;d--)if(c=b[d],Cb(a,c,"capture"),a.__propagationStopped)return;Object.defineProperty(a,"eventPhase",{value:Event.AT_TARGET});for(var e,d=0;d<b.length;d++)if(c=b[d],0===d||c.shadowRoot&&c.shadowRoot===e)if(Cb(a,c,"bubble"),c!==window&&(e=c.getRootNode()),a.__propagationStopped)break}
|
|
function Eb(){for(var a in Bb)window.addEventListener(a,function(a){a.__target||(Fb(a),Db(a),a.stopImmediatePropagation())},!0)}function Fb(a){a.__target=a.target;a.__relatedTarget=a.relatedTarget;r.settings.hasDescriptors?r.patchPrototype(a,zb):r.extend(a,zb)}var Gb=Ab(window.Event),Hb=Ab(window.CustomEvent),Ib=Ab(window.MouseEvent);
|
|
G.addEventListener=function(a,b,c){if(b){var d,e,f;"object"===typeof c?(d=!!c.capture,e=!!c.once,f=!!c.passive):(d=!!c,f=e=!1);if(b.__eventWrappers)for(var g=0;g<b.__eventWrappers.length;g++){if(b.__eventWrappers[g].node===this&&b.__eventWrappers[g].type===a&&b.__eventWrappers[g].capture===d&&b.__eventWrappers[g].once===e&&b.__eventWrappers[g].passive===f)return}else b.__eventWrappers=[];g=function(d){e&&this.removeEventListener(a,b,c);d.__target||Fb(d);if(d.composed||-1<d.composedPath().indexOf(this))if(d.eventPhase===
|
|
Event.BUBBLING_PHASE&&d.target===d.relatedTarget)d.stopImmediatePropagation();else return b(d)};b.__eventWrappers.push({node:this,type:a,capture:d,once:e,passive:f,wrapperFn:g});Bb[a]?(this.__handlers=this.__handlers||{},this.__handlers[a]=this.__handlers[a]||{capture:[],bubble:[]},this.__handlers[a][d?"capture":"bubble"].push(g)):w.addEventListener.call(this,a,g,c)}};
|
|
G.removeEventListener=function(a,b,c){if(b){var d,e,f;"object"===typeof c?(d=!!c.capture,e=!!c.once,f=!!c.passive):(d=!!c,f=e=!1);var g=void 0;if(b.__eventWrappers)for(var h=0;h<b.__eventWrappers.length;h++)if(b.__eventWrappers[h].node===this&&b.__eventWrappers[h].type===a&&b.__eventWrappers[h].capture===d&&b.__eventWrappers[h].once===e&&b.__eventWrappers[h].passive===f){g=b.__eventWrappers.splice(h,1)[0].wrapperFn;b.__eventWrappers.length||(b.__eventWrappers=void 0);break}w.removeEventListener.call(this,
|
|
a,g||b,c);g&&Bb[a]&&this.__handlers&&this.__handlers[a]&&(a=this.__handlers[a][d?"capture":"bubble"],g=a.indexOf(g),-1<g&&a.splice(g,1))}};G.patchEvents=function(){window.Event=Gb;window.CustomEvent=Hb;window.MouseEvent=Ib;Eb()};var Jb={};function Kb(a,b,c){return{index:a,removed:b,addedCount:c}}
|
|
var Lb={calcEditDistances:function(a,b,c,d,e,f){f=f-e+1;c=c-b+1;for(var g=Array(f),h=0;h<f;h++)g[h]=Array(c),g[h][0]=h;for(h=0;h<c;h++)g[0][h]=h;for(h=1;h<f;h++)for(var l=1;l<c;l++)if(this.equals(a[b+l-1],d[e+h-1]))g[h][l]=g[h-1][l-1];else{var J=g[h-1][l]+1,P=g[h][l-1]+1;g[h][l]=J<P?J:P}return g},spliceOperationsFromEditDistances:function(a){for(var b=a.length-1,c=a[0].length-1,d=a[b][c],e=[];0<b||0<c;)if(0==b)e.push(2),c--;else if(0==c)e.push(3),b--;else{var f=a[b-1][c-1],g=a[b-1][c],h=a[b][c-1],
|
|
l;l=g<h?g<f?g:f:h<f?h:f;l==f?(f==d?e.push(0):(e.push(1),d=f),b--,c--):l==g?(e.push(3),b--,d=g):(e.push(2),c--,d=h)}e.reverse();return e},calcSplices:function(a,b,c,d,e,f){var g=0,h=0,l=Math.min(c-b,f-e);0==b&&0==e&&(g=this.sharedPrefix(a,d,l));c==a.length&&f==d.length&&(h=this.sharedSuffix(a,d,l-g));b+=g;e+=g;c-=h;f-=h;if(0==c-b&&0==f-e)return[];if(b==c){for(a=Kb(b,[],0);e<f;)a.removed.push(d[e++]);return[a]}if(e==f)return[Kb(b,[],c-b)];f=this.spliceOperationsFromEditDistances(this.calcEditDistances(a,
|
|
b,c,d,e,f));a=void 0;c=[];for(g=0;g<f.length;g++)switch(f[g]){case 0:a&&(c.push(a),a=void 0);b++;e++;break;case 1:a||(a=Kb(b,[],0));a.addedCount++;b++;a.removed.push(d[e]);e++;break;case 2:a||(a=Kb(b,[],0));a.addedCount++;b++;break;case 3:a||(a=Kb(b,[],0)),a.removed.push(d[e]),e++}a&&c.push(a);return c},sharedPrefix:function(a,b,c){for(var d=0;d<c;d++)if(!this.equals(a[d],b[d]))return d;return c},sharedSuffix:function(a,b,c){for(var d=a.length,e=b.length,f=0;f<c&&this.equals(a[--d],b[--e]);)f++;return f},
|
|
calculateSplices:function(a,b){return this.calcSplices(a,0,a.length,b,0,b.length)},equals:function(a,b){return a===b}};Jb.calculateSplices=function(a,b){return Lb.calculateSplices(a,b)};var Mb={},Nb="function"===typeof Event?Event:function(a,b){b=b||{};var c=document.createEvent("Event");c.initEvent(a,!!b.bubbles,!!b.cancelable);return c};function H(a){this.root=a;this.insertionPointTag="slot"}H.prototype.getInsertionPoints=function(){return this.root.querySelectorAll(this.insertionPointTag)};H.prototype.hasInsertionPoint=function(){return!(!this.root._insertionPoints||!this.root._insertionPoints.length)};
|
|
H.prototype.isInsertionPoint=function(a){return a.localName&&a.localName==this.insertionPointTag};H.prototype.distribute=function(){return this.hasInsertionPoint()?this.distributePool(this.root,this.collectPool()):[]};H.prototype.collectPool=function(){for(var a=[],b=0,c=this.root.host.firstChild;c;c=c.nextSibling)a[b++]=c;return a};
|
|
H.prototype.distributePool=function(a,b){a=[];for(var c=this.root._insertionPoints,d=0,e=c.length,f;d<e&&(f=c[d]);d++){this.distributeInsertionPoint(f,b);var g=f.parentNode;g&&g.shadyRoot&&this.hasInsertionPoint(g.shadyRoot)&&a.push(g.shadyRoot)}for(c=0;c<b.length;c++)if(f=b[c])f.__shady=f.__shady||{},f.__shady.assignedSlot=void 0,(d=x.parentNode(f))&&w.removeChild.call(d,f);return a};
|
|
H.prototype.distributeInsertionPoint=function(a,b){var c=a.__shady.assignedNodes;c&&this.clearAssignedSlots(a,!0);a.__shady.assignedNodes=[];for(var d=!1,e=!1,f=0,g=b.length,h;f<g;f++)(h=b[f])&&this.matchesInsertionPoint(h,a)&&(h.__shady._prevAssignedSlot!=a&&(d=!0),this.distributeNodeInto(h,a),b[f]=void 0,e=!0);if(!e)for(b=a.childNodes,e=0;e<b.length;e++)h=b[e],h.__shady._prevAssignedSlot!=a&&(d=!0),this.distributeNodeInto(h,a);if(c){for(h=0;h<c.length;h++)c[h].__shady._prevAssignedSlot=null;a.__shady.assignedNodes.length<
|
|
c.length&&(d=!0)}this.setDistributedNodesOnInsertionPoint(a);d&&this._fireSlotChange(a)};H.prototype.clearAssignedSlots=function(a,b){var c=a.__shady.assignedNodes;if(c)for(var d=0;d<c.length;d++){var e=c[d];b&&(e.__shady._prevAssignedSlot=e.__shady.assignedSlot);e.__shady.assignedSlot===a&&(e.__shady.assignedSlot=null)}};H.prototype.matchesInsertionPoint=function(a,b){b=(b=b.getAttribute("name"))?b.trim():"";a=(a=a.getAttribute&&a.getAttribute("slot"))?a.trim():"";return a==b};
|
|
H.prototype.distributeNodeInto=function(a,b){b.__shady.assignedNodes.push(a);a.__shady.assignedSlot=b};H.prototype.setDistributedNodesOnInsertionPoint=function(a){var b=a.__shady.assignedNodes;a.__shady.distributedNodes=[];for(var c=0,d;c<b.length&&(d=b[c]);c++)if(this.isInsertionPoint(d)){var e=d.__shady.distributedNodes;if(e)for(var f=0;f<e.length;f++)a.__shady.distributedNodes.push(e[f])}else a.__shady.distributedNodes.push(b[c])};
|
|
H.prototype._fireSlotChange=function(a){a.dispatchEvent(new Nb("slotchange"));a.__shady.assignedSlot&&this._fireSlotChange(a.__shady.assignedSlot)};H.prototype.isFinalDestination=function(a){return!a.__shady.assignedSlot};Mb.default=H;var Ob={},Pb={};function Qb(a,b){if(a!==Pb)throw new TypeError("Illegal constructor");a=document.createDocumentFragment();a.__proto__=Qb.prototype;a._init(b);return a}Qb.prototype=Object.create(DocumentFragment.prototype);
|
|
r.extendAll(Qb.prototype,{_init:function(a){this.__localName="ShadyRoot";E.recordChildNodes(a);E.recordChildNodes(this);a.shadowRoot=this;this.host=a;this._changePending=this._hasRendered=this._renderPending=!1;this._distributor=new Mb.default(this);this.update()},update:function(){var a=this;this._renderPending||(this._renderPending=!0,Ea.enqueue(function(){return a.render()}))},_getRenderRoot:function(){for(var a=this,b=this;b;)b._renderPending&&(a=b),b=b._rendererForHost();return a},_rendererForHost:function(){var a=
|
|
this.host.getRootNode();if(r.isShadyRoot(a))for(var b=this.host.childNodes,c=0,d;c<b.length;c++)if(d=b[c],this._distributor.isInsertionPoint(d))return a},render:function(){this._renderPending&&this._getRenderRoot()._render()},_render:function(){this._changePending=this._renderPending=!1;this._skipUpdateInsertionPoints?this._hasRendered||(this._insertionPoints=[]):this.updateInsertionPoints();this._skipUpdateInsertionPoints=!1;this.distribute();this.compose();this._hasRendered=!0},forceRender:function(){this._renderPending=
|
|
!0;this.render()},distribute:function(){for(var a=this._distributor.distribute(),b=0;b<a.length;b++)a[b]._render()},updateInsertionPoints:function(){var a=this.__insertionPoints;if(a)for(var b=0,c;b<a.length;b++)c=a[b],c.getRootNode()!==this&&this._distributor.clearAssignedSlots(c);a=this._insertionPoints=this._distributor.getInsertionPoints();for(b=0;b<a.length;b++)c=a[b],c.__shady=c.__shady||{},E.recordChildNodes(c),E.recordChildNodes(c.parentNode)},get _insertionPoints(){this.__insertionPoints||
|
|
this.updateInsertionPoints();return this.__insertionPoints||(this.__insertionPoints=[])},set _insertionPoints(a){this.__insertionPoints=a},hasInsertionPoint:function(){return this._distributor.hasInsertionPoint()},compose:function(){this._composeTree()},_composeTree:function(){this._updateChildNodes(this.host,this._composeNode(this.host));for(var a=this._insertionPoints||[],b=0,c=a.length,d,e;b<c&&(d=a[b]);b++)e=d.parentNode,e!==this.host&&e!==this&&this._updateChildNodes(e,this._composeNode(e))},
|
|
_composeNode:function(a){var b=[];a=(a.shadyRoot||a).childNodes;for(var c=0;c<a.length;c++){var d=a[c];if(this._distributor.isInsertionPoint(d))for(var e=d.__shady.distributedNodes||(d.__shady.distributedNodes=[]),f=0;f<e.length;f++){var g=e[f];this.isFinalDestination(d,g)&&b.push(g)}else b.push(d)}return b},isFinalDestination:function(a,b){return this._distributor.isFinalDestination(a,b)},_updateChildNodes:function(a,b){for(var c=x.childNodes(a),d=Jb.calculateSplices(b,c),e=0,f=0,g;e<d.length&&(g=
|
|
d[e]);e++){for(var h=0,l;h<g.removed.length&&(l=g.removed[h]);h++)x.parentNode(l)===a&&w.removeChild.call(a,l),c.splice(g.index+f,1);f-=g.addedCount}for(e=0;e<d.length&&(g=d[e]);e++)for(f=c[g.index],h=g.index;h<g.index+g.addedCount;h++)l=b[h],w.insertBefore.call(a,l,f),c.splice(h,0,l)},getInsertionPointTag:function(){return this._distributor.insertionPointTag}});B.patchShadowRootAccessors(Qb.prototype);Ob.ShadyRoot=Qb;
|
|
Ob.attachShadow=function(a,b){if(!a)throw"Must provide a host.";if(!b)throw"Not enough arguments.";return new Qb(Pb,a)};var Rb={};function Sb(a){F.renderRootNode(a);return A.getProperty(a,"assignedSlot")||null}
|
|
var Tb={addEventListener:G.addEventListener,removeEventListener:G.removeEventListener,appendChild:function(a){return F.insertBefore(this,a)},insertBefore:function(a,b){return F.insertBefore(this,a,b)},removeChild:function(a){return F.removeChild(this,a)},replaceChild:function(a,b){this.insertBefore(a,b);this.removeChild(b);return a},cloneNode:function(a){return F.cloneNode(this,a)},getRootNode:function(a){return F.getRootNode(this,a)},get isConnected(){var a=this.ownerDocument;if(a&&a.contains&&a.contains(this)||
|
|
(a=a.documentElement)&&a.contains&&a.contains(this))return!0;for(a=this;a&&!(a instanceof Document);)a=a.parentNode||(a instanceof Ob.ShadyRoot?a.host:void 0);return!!(a&&a instanceof Document)}},Ub={get assignedSlot(){return Sb(this)}},Vb={querySelector:function(a){return F.query(this,function(b){return r.matchesSelector(b,a)},function(a){return!!a})[0]||null},querySelectorAll:function(a){return F.query(this,function(b){return r.matchesSelector(b,a)})}},Wb={assignedNodes:function(a){if("slot"===
|
|
this.localName)return F.renderRootNode(this),this.__shady?(a&&a.flatten?this.__shady.distributedNodes:this.__shady.assignedNodes)||[]:[]}},Xb=r.extendAll({setAttribute:function(a,b){F.setAttribute(this,a,b)},removeAttribute:function(a){F.removeAttribute(this,a)},attachShadow:function(a){return Ob.attachShadow(this,a)},get slot(){return this.getAttribute("slot")},set slot(a){this.setAttribute("slot",a)},get assignedSlot(){return Sb(this)}},Vb,Wb);Object.defineProperties(Xb,B.ShadowRootAccessor);
|
|
var Yb=r.extendAll({importNode:function(a,b){return F.importNode(a,b)}},Vb);Object.defineProperties(Yb,{_activeElement:B.ActiveElementAccessor.activeElement});function Zb(a,b){for(var c=Object.getOwnPropertyNames(b),d=0;d<c.length;d++){var e=c[d],f=Object.getOwnPropertyDescriptor(b,e);f.value?a[e]=f.value:Object.defineProperty(a,e,f)}}
|
|
Rb.patchBuiltins=function(){Zb(window.Node.prototype,Tb);Zb(window.Text.prototype,Ub);Zb(window.DocumentFragment.prototype,Vb);Zb(window.Element.prototype,Xb);Zb(window.Document.prototype,Yb);window.HTMLSlotElement&&Zb(window.HTMLSlotElement.prototype,Wb);r.settings.hasDescriptors&&(B.patchAccessors(window.Node.prototype),B.patchAccessors(window.Text.prototype),B.patchAccessors(window.DocumentFragment.prototype),B.patchAccessors(window.Element.prototype),B.patchAccessors((window.customElements&&customElements.nativeHTMLElement||
|
|
HTMLElement).prototype),B.patchAccessors(window.Document.prototype),window.HTMLSlotElement&&B.patchAccessors(window.HTMLSlotElement.prototype))};r.settings.inUse&&(window.ShadyDOM={inUse:r.settings.inUse,patch:function(a){return a},isShadyRoot:r.isShadyRoot,enqueue:Ea.enqueue,flush:Ea.flush,settings:r.settings,filterMutations:v.filterMutations,observeChildren:v.observeChildren,unobserveChildren:v.unobserveChildren,nativeMethods:w,nativeTree:x},G.patchEvents(),Rb.patchBuiltins(),window.ShadowRoot=Ob.ShadyRoot);/*
|
|
|
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
Code distributed by Google as part of the polymer project is also
|
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
*/
|
|
var I={};function $b(){this.end=this.start=0;this.rules=this.parent=this.previous=null;this.cssText=this.parsedCssText="";this.atRule=!1;this.type=0;this.parsedSelector=this.selector=this.keyframesName=""}
|
|
function ac(a,b){var c=b.substring(a.start,a.end-1);a.parsedCssText=a.cssText=c.trim();a.parent&&(c=b.substring(a.previous?a.previous.end:a.parent.start,a.start-1),c=bc(c),c=c.replace(K.multipleSpaces," "),c=c.substring(c.lastIndexOf(";")+1),c=a.parsedSelector=a.selector=c.trim(),a.atRule=0===c.indexOf("@"),a.atRule?0===c.indexOf("@media")?a.type=cc.MEDIA_RULE:c.match(K.keyframesRule)&&(a.type=cc.KEYFRAMES_RULE,a.keyframesName=a.selector.split(K.multipleSpaces).pop()):0===c.indexOf("--")?a.type=cc.MIXIN_RULE:
|
|
a.type=cc.STYLE_RULE);if(c=a.rules)for(var d=0,e=c.length,f;d<e&&(f=c[d]);d++)ac(f,b);return a}function bc(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,c){a=c;for(c=6-a.length;c--;)a="0"+a;return"\\"+a})}
|
|
function dc(a,b,c){c=void 0===c?"":c;var d="";if(a.cssText||a.rules){var e=a.rules,f;if(f=e)f=e[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var g=e.length,h;f<g&&(h=e[f]);f++)d=dc(h,b,d)}else b?b=a.cssText:(b=a.cssText,b=ec(b),b=b.replace(K.mixinApply,"").replace(K.varApply,"")),(d=b.trim())&&(d=" "+d+"\n")}d&&(a.selector&&(c+=a.selector+" {\n"),c+=d,a.selector&&(c+="}\n\n"));return c}function ec(a){return a.replace(K.customProp,"").replace(K.mixinProp,"")}
|
|
var cc={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1E3},K={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g};I.StyleNode=$b;
|
|
I.parse=function(a){var b=a=a.replace(K.comments,"").replace(K.port,""),c=new $b;c.start=0;c.end=b.length;for(var d=c,e=0,f=b.length;e<f;e++)if("{"===b[e]){d.rules||(d.rules=[]);var g=d,h=g.rules[g.rules.length-1]||null,d=new $b;d.start=e+1;d.parent=g;d.previous=h;g.rules.push(d)}else"}"===b[e]&&(d.end=e+1,d=d.parent||c);return ac(c,a)};I.stringify=dc;I.removeCustomPropAssignment=ec;I.types=cc;var L={},fc=!(window.ShadyDOM&&window.ShadyDOM.inUse),gc=!navigator.userAgent.match("AppleWebKit/601")&&window.CSS&&CSS.supports&&CSS.supports("box-shadow","0 0 0 var(--foo)");function hc(a){a&&(gc=gc&&!a.nativeCss&&!a.shimcssproperties,fc=fc&&!a.nativeShadow&&!a.shimshadow)}window.ShadyCSS?hc(window.ShadyCSS):window.WebComponents&&hc(window.WebComponents.flags);L.nativeShadow=fc;L.nativeCssVariables=gc;var M={VAR_ASSIGN:/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\s}])|$)/gi,MIXIN_MATCH:/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,VAR_CONSUMED:/(--[\w-]+)\s*([:,;)]|$)/gi,ANIMATION_MATCH:/(animation\s*:)|(animation-name\s*:)/,MEDIA_MATCH:/@media[^(]*(\([^)]*\))/,IS_VAR:/^--/,BRACKETED:/\{[^}]*\}/g,HOST_PREFIX:"(?:^|[^.#[:])",HOST_SUFFIX:"($|[.:[\\s>+~])"};var N={};function ic(a,b,c,d){if(a){var e=!1,f=a.type;if(d&&f===I.types.MEDIA_RULE){var g=a.selector.match(M.MEDIA_MATCH);g&&(window.matchMedia(g[1]).matches||(e=!0))}f===I.types.STYLE_RULE?b(a):c&&f===I.types.KEYFRAMES_RULE?c(a):f===I.types.MIXIN_RULE&&(e=!0);if((a=a.rules)&&!e)for(var e=0,f=a.length,h;e<f&&(h=a[e]);e++)ic(h,b,c,d)}}function jc(a,b){var c=document.createElement("style");b&&c.setAttribute("scope",b);c.textContent=a;return c}var O=null;
|
|
function kc(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);O?a.compareDocumentPosition(O)===Node.DOCUMENT_POSITION_PRECEDING&&(O=a):O=a}
|
|
function lc(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");var d;a:{var e=0;d=c+3;for(var f=a.length;d<f;d++)if("("===a[d])e++;else if(")"===a[d]&&0===--e)break a;d=-1}e=a.substring(c+4,d);c=a.substring(0,c);a=lc(a.substring(d+1),b);f=e.indexOf(",");if(-1===f)return b(c,e.trim(),"",a);d=e.substring(0,f).trim();e=e.substring(f+1).trim();return b(c,d,e,a)}N.toCssText=function(a,b){"string"===typeof a&&(a=I.parse(a));b&&ic(a,b);return I.stringify(a,L.nativeCssVariables)};
|
|
N.rulesForStyle=function(a){!a.__cssRules&&a.textContent&&(a.__cssRules=I.parse(a.textContent));return a.__cssRules};N.isKeyframesSelector=function(a){return!!a.parent&&a.parent.type===I.types.KEYFRAMES_RULE};N.forEachRule=ic;N.applyCss=function(a,b,c,d){a=jc(a,b);kc(a,c,d);return a};N.createScopeStyle=jc;N.applyStylePlaceHolder=function(a){a=document.createComment(" Shady DOM styles for "+a+" ");var b=document.head;b.insertBefore(a,(O?O.nextSibling:null)||b.firstChild);return O=a};N.applyStyle=kc;
|
|
N.isTargetedBuild=function(a){return L.nativeShadow?"shadow"===a:"shady"===a};N.getCssBuildType=function(a){return a.getAttribute("css-build")};N.processVariableAndFallback=lc;N.setElementClassRaw=function(a,b){L.nativeShadow?a.setAttribute("class",b):window.ShadyDOM.nativeMethods.setAttribute.call(a,"class",b)};N.getIsExtends=function(a){var b=a.localName,c="";b?-1<b.indexOf("-")||(c=b,b=a.getAttribute&&a.getAttribute("is")||""):(b=a.is,c=a.extends);return{is:b,typeExtension:c}};var Q={};function R(){}R.prototype.dom=function(a,b,c){a.__styleScoped?a.__styleScoped=null:this._transformDom(a,b||"",c)};R.prototype._transformDom=function(a,b,c){a.nodeType===Node.ELEMENT_NODE&&this.element(a,b,c);if(a="template"===a.localName?(a.content||a._content).childNodes:a.children||a.childNodes)for(var d=0;d<a.length;d++)this._transformDom(a[d],b,c)};
|
|
R.prototype.element=function(a,b,c){if(b)if(a.classList)c?(a.classList.remove("style-scope"),a.classList.remove(b)):(a.classList.add("style-scope"),a.classList.add(b));else if(a.getAttribute){var d=a.getAttribute(mc);c?d&&(b=d.replace("style-scope","").replace(b,""),N.setElementClassRaw(a,b)):N.setElementClassRaw(a,(d?d+" ":"")+"style-scope "+b)}};
|
|
R.prototype.elementStyles=function(a,b,c){var d=a.__cssBuild;L.nativeShadow||"shady"===d?b=N.toCssText(b,c):(a=N.getIsExtends(a),b=this.css(b,a.is,a.typeExtension,c)+"\n\n");return b.trim()};R.prototype.css=function(a,b,c,d){var e=this._calcHostScope(b,c);b=this._calcElementScope(b);var f=this;return N.toCssText(a,function(a){a.isScoped||(f.rule(a,b,e),a.isScoped=!0);d&&d(a,b,e)})};R.prototype._calcElementScope=function(a){return a?nc+a:""};
|
|
R.prototype._calcHostScope=function(a,b){return b?"[is="+a+"]":a};R.prototype.rule=function(a,b,c){this._transformRule(a,this._transformComplexSelector,b,c)};R.prototype._transformRule=function(a,b,c,d){a.selector=a.transformedSelector=this._transformRuleCss(a,b,c,d)};R.prototype._transformRuleCss=function(a,b,c,d){var e=a.selector.split(oc);if(!N.isKeyframesSelector(a)){a=0;for(var f=e.length,g;a<f&&(g=e[a]);a++)e[a]=b.call(this,g,c,d)}return e.join(oc)};
|
|
R.prototype._transformComplexSelector=function(a,b,c){var d=this,e=!1;a=a.trim();a=a.replace(pc,function(a,b,c){return":"+b+"("+c.replace(/\s/g,"")+")"});a=a.replace(qc,rc+" $1");return a=a.replace(sc,function(a,g,h){e||(a=d._transformCompoundSelector(h,g,b,c),e=e||a.stop,g=a.combinator,h=a.value);return g+h})};
|
|
R.prototype._transformCompoundSelector=function(a,b,c,d){var e=a.indexOf(tc);0<=a.indexOf(rc)?a=this._transformHostSelector(a,d):0!==e&&(a=c?this._transformSimpleSelector(a,c):a);c=!1;0<=e&&(b="",c=!0);var f;c&&(f=!0,c&&(a=a.replace(uc,function(a,b){return" > "+b})));a=a.replace(vc,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,combinator:b,stop:f}};R.prototype._transformSimpleSelector=function(a,b){a=a.split(wc);a[0]+=b;return a.join(wc)};
|
|
R.prototype._transformHostSelector=function(a,b){var c=a.match(xc);return(c=c&&c[2].trim()||"")?c[0].match(yc)?a.replace(xc,function(a,c,f){return b+f}):c.split(yc)[0]===b?c:zc:a.replace(rc,b)};R.prototype.documentRule=function(a){a.selector=a.parsedSelector;this.normalizeRootSelector(a);this._transformRule(a,this._transformDocumentSelector)};R.prototype.normalizeRootSelector=function(a){a.selector===Ac&&(a.selector="html")};
|
|
R.prototype._transformDocumentSelector=function(a){return a.match(tc)?this._transformComplexSelector(a,Bc):this._transformSimpleSelector(a.trim(),Bc)};aa.global.Object.defineProperties(R.prototype,{SCOPE_NAME:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}});
|
|
var pc=/:(nth[-\w]+)\(([^)]+)\)/,Bc=":not(.style-scope)",oc=",",sc=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,yc=/[[.:#*]/,rc=":host",Ac=":root",tc="::slotted",qc=new RegExp("^("+tc+")"),xc=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,uc=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,vc=/(.*):dir\((?:(ltr|rtl))\)/,nc=".",wc=":",mc="class",zc="should_not_match",Cc=new R;Q.default=Cc;var S={};function Dc(a,b,c,d,e,f){this.styleRules=a||null;this.placeholder=b||null;this.ownStylePropertyNames=c||[];this.overrideStyleProperties=null;this.elementName=d||"";this.cssBuild=f||"";this.typeExtension=e||"";this.customStyle=this.scopeSelector=this.styleProperties=null}Dc.get=function(a){return a?a.__styleInfo:null};Dc.set=function(a,b){return a.__styleInfo=b};Dc.prototype._getStyleRules=function(){return this.styleRules};Dc.prototype._getStyleRules=Dc.prototype._getStyleRules;
|
|
S.default=Dc;var T={},Ec=window.Element.prototype,Fc=Ec.matches||Ec.matchesSelector||Ec.mozMatchesSelector||Ec.msMatchesSelector||Ec.oMatchesSelector||Ec.webkitMatchesSelector,Gc=navigator.userAgent.match("Trident");function U(){}U.prototype.decorateStyles=function(a){var b=this,c={},d=[],e=0;N.forEachRule(a,function(a){b.decorateRule(a);a.index=e++;b.collectPropertiesInCssText(a.propertyInfo.cssText,c)},function(a){d.push(a)});a._keyframes=d;a=[];for(var f in c)a.push(f);return a};
|
|
U.prototype.decorateRule=function(a){if(a.propertyInfo)return a.propertyInfo;var b={},c={};this.collectProperties(a,c)&&(b.properties=c,a.rules=null);b.cssText=this.collectCssText(a);return a.propertyInfo=b};U.prototype.collectProperties=function(a,b){var c=a.propertyInfo;if(c){if(c.properties)return Object.assign(b,c.properties),!0}else{for(var c=M.VAR_ASSIGN,d=a.parsedCssText,e;a=c.exec(d);){e=(a[2]||a[3]).trim();if("inherit"!==e||"unset"!==e)b[a[1].trim()]=e;e=!0}return e}};
|
|
U.prototype.collectCssText=function(a){return this.collectConsumingCssText(a.parsedCssText)};U.prototype.collectConsumingCssText=function(a){return a.replace(M.BRACKETED,"").replace(M.VAR_ASSIGN,"")};U.prototype.collectPropertiesInCssText=function(a,b){for(var c;c=M.VAR_CONSUMED.exec(a);){var d=c[1];":"!==c[2]&&(b[d]=!0)}};U.prototype.reify=function(a){for(var b=Object.getOwnPropertyNames(a),c=0,d;c<b.length;c++)d=b[c],a[d]=this.valueForProperty(a[d],a)};
|
|
U.prototype.valueForProperty=function(a,b){if(a)if(0<=a.indexOf(";"))a=this.valueForProperties(a,b);else{var c=this;a=N.processVariableAndFallback(a,function(a,e,f,g){if(!e)return a+g;(e=c.valueForProperty(b[e],b))&&"initial"!==e?"apply-shim-inherit"===e&&(e="inherit"):e=c.valueForProperty(b[f]||f,b)||f;return a+(e||"")+g})}return a&&a.trim()||""};
|
|
U.prototype.valueForProperties=function(a,b){a=a.split(";");for(var c=0,d,e;c<a.length;c++)if(d=a[c]){M.MIXIN_MATCH.lastIndex=0;if(e=M.MIXIN_MATCH.exec(d))d=this.valueForProperty(b[e[1]],b);else if(e=d.indexOf(":"),-1!==e){var f=d.substring(e),f=f.trim(),f=this.valueForProperty(f,b)||f;d=d.substring(0,e)+f}a[c]=d&&d.lastIndexOf(";")===d.length-1?d.slice(0,-1):d||""}return a.join(";")};
|
|
U.prototype.applyProperties=function(a,b){var c="";a.propertyInfo||this.decorateRule(a);a.propertyInfo.cssText&&(c=this.valueForProperties(a.propertyInfo.cssText,b));a.cssText=c};
|
|
U.prototype.applyKeyframeTransforms=function(a,b){var c=a.cssText,d=a.cssText;null==a.hasAnimations&&(a.hasAnimations=M.ANIMATION_MATCH.test(c));if(a.hasAnimations)if(null==a.keyframeNamesToTransform){a.keyframeNamesToTransform=[];for(var e in b)d=b[e],d=d(c),c!==d&&(c=d,a.keyframeNamesToTransform.push(e))}else{for(e=0;e<a.keyframeNamesToTransform.length;++e)d=b[a.keyframeNamesToTransform[e]],c=d(c);d=c}a.cssText=d};
|
|
U.prototype.propertyDataFromStyles=function(a,b){var c={},d=this,e=[];N.forEachRule(a,function(a){a.propertyInfo||d.decorateRule(a);var f=a.transformedSelector||a.parsedSelector;b&&a.propertyInfo.properties&&f&&Fc.call(b,f)&&(d.collectProperties(a,c),a=a.index,f=parseInt(a/32,10),e[f]=(e[f]||0)|1<<a%32)},null,!0);return{properties:c,key:e}};
|
|
U.prototype.whenHostOrRootRule=function(a,b,c,d){b.propertyInfo||this.decorateRule(b);if(b.propertyInfo.properties){var e=N.getIsExtends(a),f=e.is,e=e.typeExtension;a=a.is?Q.default._calcHostScope(f,e):"html";var g=b.parsedSelector,e=":host > *"===g||"html"===g,h=0===g.indexOf(":host")&&!e;"shady"===c&&(e=g===a+" > *."+a||-1!==g.indexOf("html"),h=!e&&0===g.indexOf(a));"shadow"===c&&(e=":host > *"===g||"html"===g,h=h&&!e);if(e||h)c=a,h&&(L.nativeShadow&&!b.transformedSelector&&(b.transformedSelector=
|
|
Q.default._transformRuleCss(b,Q.default._transformComplexSelector,Q.default._calcElementScope(f),a)),c=b.transformedSelector||a),d({selector:c,isHost:h,isRoot:e})}};U.prototype.hostAndRootPropertiesForScope=function(a,b){var c={},d={},e=this,f=b&&b.__cssBuild;N.forEachRule(b,function(b){e.whenHostOrRootRule(a,b,f,function(f){Fc.call(a._element||a,f.selector)&&(f.isHost?e.collectProperties(b,c):e.collectProperties(b,d))})},null,!0);return{rootProps:d,hostProps:c}};
|
|
U.prototype.transformStyles=function(a,b,c){var d=this,e=N.getIsExtends(a),f=Q.default._calcHostScope(e.is,e.typeExtension),e=a.extends?"\\"+f.slice(0,-1)+"\\]":f,g=new RegExp(M.HOST_PREFIX+e+M.HOST_SUFFIX),e=S.default.get(a).styleRules,h=this._elementKeyframeTransforms(a,e,c);return Q.default.elementStyles(a,e,function(a){d.applyProperties(a,b);L.nativeShadow||N.isKeyframesSelector(a)||!a.cssText||(d.applyKeyframeTransforms(a,h),d._scopeSelector(a,g,f,c))})};
|
|
U.prototype._elementKeyframeTransforms=function(a,b,c){a=b._keyframes;b={};if(!L.nativeShadow&&a)for(var d=0,e=a[d];d<a.length;e=a[++d])this._scopeKeyframes(e,c),b[e.keyframesName]=this._keyframesRuleTransformer(e);return b};U.prototype._keyframesRuleTransformer=function(a){return function(b){return b.replace(a.keyframesNameRx,a.transformedKeyframesName)}};
|
|
U.prototype._scopeKeyframes=function(a,b){a.keyframesNameRx=new RegExp(a.keyframesName,"g");a.transformedKeyframesName=a.keyframesName+"-"+b;a.transformedSelector=a.transformedSelector||a.selector;a.selector=a.transformedSelector.replace(a.keyframesName,a.transformedKeyframesName)};
|
|
U.prototype._scopeSelector=function(a,b,c,d){a.transformedSelector=a.transformedSelector||a.selector;d="."+d;for(var e=a.transformedSelector.split(","),f=0,g=e.length,h;f<g&&(h=e[f]);f++)e[f]=h.match(b)?h.replace(c,d):d+" "+h;a.selector=e.join(",")};U.prototype.applyElementScopeSelector=function(a,b,c){var d=a.getAttribute("class")||"",e=d;c&&(e=d.replace(new RegExp("\\s*x-scope\\s*"+c+"\\s*","g")," "));e+=(e?" ":"")+"x-scope "+b;d!==e&&N.setElementClassRaw(a,e)};
|
|
U.prototype.applyElementStyle=function(a,b,c,d){b=d?d.textContent||"":this.transformStyles(a,b,c);var e=S.default.get(a),f=e.customStyle;f&&!L.nativeShadow&&f!==d&&(f._useCount--,0>=f._useCount&&f.parentNode&&f.parentNode.removeChild(f));L.nativeShadow?e.customStyle?(e.customStyle.textContent=b,d=e.customStyle):b&&(d=N.applyCss(b,c,a.shadowRoot,e.placeholder)):d?d.parentNode||N.applyStyle(d,null,e.placeholder):b&&(d=N.applyCss(b,c,null,e.placeholder));d&&(d._useCount=d._useCount||0,e.customStyle!=
|
|
d&&d._useCount++,e.customStyle=d);Gc&&(d.textContent=d.textContent);return d};U.prototype.applyCustomStyle=function(a,b){var c=N.rulesForStyle(a),d=this;a.textContent=N.toCssText(c,function(a){var c=a.cssText=a.parsedCssText;a.propertyInfo&&a.propertyInfo.cssText&&(c=I.removeCustomPropAssignment(c),a.cssText=d.valueForProperties(c,b))})};aa.global.Object.defineProperties(U.prototype,{XSCOPE_NAME:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var Hc=new U;T.default=Hc;var Ic={},Jc={},Kc=window.customElements;if(Kc&&!L.nativeShadow){var Lc=Kc.define;Kc.define=function(a,b,c){Jc[a]=N.applyStylePlaceHolder(a);return Lc.call(Kc,a,b,c)}}Ic.default=Jc;var Mc={};function Nc(a){this.cache={};this.typeMax=void 0===a?100:a}Nc.prototype._validate=function(a,b,c){for(var d=0;d<c.length;d++){var e=c[d];if(a.properties[e]!==b[e])return!1}return!0};Nc.prototype.store=function(a,b,c,d){var e=this.cache[a]||[];e.push({properties:b,styleElement:c,scopeSelector:d});e.length>this.typeMax&&e.shift();this.cache[a]=e};Nc.prototype.fetch=function(a,b,c){if(a=this.cache[a])for(var d=a.length-1;0<=d;d--){var e=a[d];if(this._validate(e,b,c))return e}};Mc.default=Nc;var Oc={};function Pc(){}
|
|
if(!L.nativeShadow){var Qc=function(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.target!==document.documentElement&&c.target!==document.head){for(var d=0;d<c.addedNodes.length;d++){var e=c.addedNodes[d],f=e;if(f.classList&&!f.classList.contains(Q.default.SCOPE_NAME)||f instanceof window.SVGElement&&(!f.hasAttribute("class")||0>f.getAttribute("class").indexOf(Q.default.SCOPE_NAME)))if(f=e.getRootNode(),f.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(f=f.host))f=N.getIsExtends(f).is,Q.default.dom(e,f)}for(d=
|
|
0;d<c.removedNodes.length;d++)if(e=c.removedNodes[d],e.nodeType===Node.ELEMENT_NODE&&(f=void 0,e.classList?f=Array.from(e.classList):e.hasAttribute("class")&&(f=e.getAttribute("class").split(/\s+/)),void 0!==f)){var g=f.indexOf(Q.default.SCOPE_NAME);0<=g&&(f=f[g+1])&&Q.default.dom(e,f,!0)}}}},Rc=new MutationObserver(Qc),Sc=function(a){Rc.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.flush)Sc(document);else{var Tc=function(){Sc(document.body)};window.HTMLImports?
|
|
window.HTMLImports.whenReady(Tc):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){Tc();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange",a)}else Tc()})}Pc=function(){Qc(Rc.takeRecords())}}Oc.flush=Pc;var V={default:{}};var W={},Uc=Promise.resolve();function Vc(a){a._applyShimInvalid=!0}function Wc(a){return!a._applyShimInvalid}function Xc(a){a._validating||(a._validating=!0,Uc.then(function(){a._applyShimInvalid=!1;a._validating=!1}))}W.invalidate=function(a){(a=V.default[a])&&Vc(a)};W.invalidateTemplate=Vc;W.isValid=function(a){return(a=V.default[a])?Wc(a):!0};W.templateIsValid=Wc;W.isValidating=function(a){return(a=V.default[a])?a._validating:!1};W.templateIsValidating=function(a){return a._validating};
|
|
W.startValidating=function(a){Xc(V.default[a])};W.startValidatingTemplate=Xc;W.elementsAreInvalid=function(){for(var a in V.default)if(!Wc(V.default[a]))return!0;return!1};var Yc={},Zc=null,$c=window.HTMLImports&&window.HTMLImports.whenReady||null,ad;Yc.default=function(a){$c?$c(a):(Zc||(Zc=new Promise(function(a){ad=a}),"complete"===document.readyState?ad():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&ad()})),Zc.then(function(){a&&a()}))};var bd={updateNativeProperties:function(a,b){for(var c in b)null===c?a.style.removeProperty(c):a.style.setProperty(c,b[c])},getComputedStyleValue:function(a,b){return(a=window.getComputedStyle(a).getPropertyValue(b))?a.trim():""}};var cd=null,dd=null;function X(){this.customStyles=[];this.enqueued=!1}X.prototype.enqueueDocumentValidation=function(){!this.enqueued&&dd&&(this.enqueued=!0,Yc.default(dd))};X.prototype.addCustomStyle=function(a){a.__seenByShadyCSS||(a.__seenByShadyCSS=!0,this.customStyles.push(a),this.enqueueDocumentValidation())};X.prototype.getStyleForCustomStyle=function(a){return a.getStyle?a.getStyle():a};
|
|
X.prototype.processStyles=function(){for(var a=this.customStyles,b=0;b<a.length;b++){var c=a[b];if(!c.__processedByShadyCSS){var d=this.getStyleForCustomStyle(c);if(d){c.__processedByShadyCSS=!0;if(c=d.__appliedElement)for(var e=0;e<d.attributes.length;e++){var f=d.attributes[e];c.setAttribute(f.name,f.value)}cd&&cd(c||d)}}}return a};X.prototype.addCustomStyle=X.prototype.addCustomStyle;X.prototype.getStyleForCustomStyle=X.prototype.getStyleForCustomStyle;X.prototype.processStyles=X.prototype.processStyles;
|
|
Object.defineProperties(X.prototype,{transformCallback:{get:function(){return cd},set:function(a){cd=a}},validateCallback:{get:function(){return dd},set:function(a){var b=!1;dd||(b=!0);dd=a;b&&this.enqueueDocumentValidation()}}});var ed={},fd=new Mc.default;function Y(){var a=this;this._scopeCounter={};this._documentOwner=document.documentElement;var b=new I.StyleNode;b.rules=[];this._documentOwnerStyleInfo=S.default.set(this._documentOwner,new S.default(b));this._elementsHaveApplied=!1;this._customStyleInterface=this._applyShim=null;Yc.default(function(){a._ensure()})}Y.prototype.flush=function(){Oc.flush()};
|
|
Y.prototype._generateScopeSelector=function(a){var b=this._scopeCounter[a]=(this._scopeCounter[a]||0)+1;return a+"-"+b};Y.prototype.getStyleAst=function(a){return N.rulesForStyle(a)};Y.prototype.styleAstToString=function(a){return N.toCssText(a)};Y.prototype._gatherStyles=function(a){a=a.content.querySelectorAll("style");for(var b=[],c=0;c<a.length;c++){var d=a[c];b.push(d.textContent);d.parentNode.removeChild(d)}return b.join("").trim()};
|
|
Y.prototype._getCssBuild=function(a){return(a=a.content.querySelector("style"))?a.getAttribute("css-build")||"":""};
|
|
Y.prototype.prepareTemplate=function(a,b,c){if(!a._prepared){a._prepared=!0;a.name=b;a.extends=c;V.default[b]=a;var d=this._getCssBuild(a),e=this._gatherStyles(a);c={is:b,extends:c,__cssBuild:d};L.nativeShadow||Q.default.dom(a.content,b);this._ensure();var f=this._applyShim.detectMixin(e),e=I.parse(e);f&&L.nativeCssVariables&&this._applyShim.transformRules(e,b);a._styleAst=e;a._cssBuild=d;d=[];L.nativeCssVariables||(d=T.default.decorateStyles(a._styleAst,c));if(!d.length||L.nativeCssVariables)b=this._generateStaticStyle(c,
|
|
a._styleAst,L.nativeShadow?a.content:null,Ic.default[b]),a._style=b;a._ownPropertyNames=d}};Y.prototype._generateStaticStyle=function(a,b,c,d){b=Q.default.elementStyles(a,b);if(b.length)return N.applyCss(b,a.is,c,d)};Y.prototype._prepareHost=function(a){var b=N.getIsExtends(a),c=b.is,b=b.typeExtension,d=Ic.default[c],e=V.default[c],f,g,h;e&&(f=e._styleAst,g=e._ownPropertyNames,h=e._cssBuild);return S.default.set(a,new S.default(f,d,g,c,b,h))};
|
|
Y.prototype._ensureApplyShim=function(){if(!this._applyShim)if(window.ShadyCSS.ApplyShim)this._applyShim=window.ShadyCSS.ApplyShim,this._applyShim.invalidCallback=W.invalidate;else{var a={};this._applyShim=(a.detectMixin=function(){return!1},a.transformRule=function(){},a.transformRules=function(){},a)}};
|
|
Y.prototype._ensureCustomStyleInterface=function(){var a=this;if(!this._customStyleInterface)if(window.ShadyCSS.CustomStyleInterface)this._customStyleInterface=window.ShadyCSS.CustomStyleInterface,this._customStyleInterface.transformCallback=function(b){a.transformCustomStyleForDocument(b)},this._customStyleInterface.validateCallback=function(){requestAnimationFrame(function(){(a._customStyleInterface.enqueued||a._elementsHaveApplied)&&a.flushCustomStyles()})};else{var b={};this._customStyleInterface=
|
|
(b.processStyles=function(){},b.enqueued=!1,b.getStyleForCustomStyle=function(){return null},b)}};Y.prototype._ensure=function(){this._ensureApplyShim();this._ensureCustomStyleInterface()};
|
|
Y.prototype.flushCustomStyles=function(){this._ensure();var a=this._customStyleInterface.processStyles();this._customStyleInterface.enqueued&&(L.nativeCssVariables?this._revalidateCustomStyleApplyShim(a):(this._updateProperties(this._documentOwner,this._documentOwnerStyleInfo),this._applyCustomStyles(a)),this._customStyleInterface.enqueued=!1,this._elementsHaveApplied&&!L.nativeCssVariables&&this.styleDocument())};
|
|
Y.prototype.styleElement=function(a,b){var c=N.getIsExtends(a).is,d=S.default.get(a);d||(d=this._prepareHost(a));this._isRootOwner(a)||(this._elementsHaveApplied=!0);b&&(d.overrideStyleProperties=d.overrideStyleProperties||{},Object.assign(d.overrideStyleProperties,b));if(L.nativeCssVariables){if(d.overrideStyleProperties&&bd.updateNativeProperties(a,d.overrideStyleProperties),((b=V.default[c])||this._isRootOwner(a))&&b&&b._style&&!W.templateIsValid(b))W.templateIsValidating(b)||(this._ensure(),this._applyShim.transformRules(b._styleAst,
|
|
c),b._style.textContent=Q.default.elementStyles(a,d.styleRules),W.startValidatingTemplate(b)),L.nativeShadow&&(c=a.shadowRoot)&&(c.querySelector("style").textContent=Q.default.elementStyles(a,d.styleRules)),d.styleRules=b._styleAst}else this._updateProperties(a,d),d.ownStylePropertyNames&&d.ownStylePropertyNames.length&&this._applyStyleProperties(a,d)};Y.prototype._styleOwnerForNode=function(a){return(a=a.getRootNode().host)?S.default.get(a)?a:this._styleOwnerForNode(a):this._documentOwner};
|
|
Y.prototype._isRootOwner=function(a){return a===this._documentOwner};
|
|
Y.prototype._applyStyleProperties=function(a,b){var c=N.getIsExtends(a).is,d=fd.fetch(c,b.styleProperties,b.ownStylePropertyNames),e=d?d.styleElement:null,f=b.scopeSelector;b.scopeSelector=d&&d.scopeSelector||this._generateScopeSelector(c);e=T.default.applyElementStyle(a,b.styleProperties,b.scopeSelector,e);L.nativeShadow||T.default.applyElementScopeSelector(a,b.scopeSelector,f);d||fd.store(c,b.styleProperties,e,b.scopeSelector);return e};
|
|
Y.prototype._updateProperties=function(a,b){var c=this._styleOwnerForNode(a),d=S.default.get(c),c=Object.create(d.styleProperties||null),e=T.default.hostAndRootPropertiesForScope(a,b.styleRules);a=T.default.propertyDataFromStyles(d.styleRules,a).properties;Object.assign(c,e.hostProps,a,e.rootProps);this._mixinOverrideStyles(c,b.overrideStyleProperties);T.default.reify(c);b.styleProperties=c};Y.prototype._mixinOverrideStyles=function(a,b){for(var c in b){var d=b[c];if(d||0===d)a[c]=d}};
|
|
Y.prototype.styleDocument=function(a){this.styleSubtree(this._documentOwner,a)};Y.prototype.styleSubtree=function(a,b){var c=a.shadowRoot;(c||this._isRootOwner(a))&&this.styleElement(a,b);if(b=c&&(c.children||c.childNodes))for(a=0;a<b.length;a++)this.styleSubtree(b[a]);else if(a=a.children||a.childNodes)for(b=0;b<a.length;b++)this.styleSubtree(a[b])};
|
|
Y.prototype._revalidateCustomStyleApplyShim=function(a){for(var b=0;b<a.length;b++){var c=this._customStyleInterface.getStyleForCustomStyle(a[b]);c&&this._revalidateApplyShim(c)}};Y.prototype._applyCustomStyles=function(a){for(var b=0;b<a.length;b++){var c=this._customStyleInterface.getStyleForCustomStyle(a[b]);c&&T.default.applyCustomStyle(c,this._documentOwnerStyleInfo.styleProperties)}};
|
|
Y.prototype.transformCustomStyleForDocument=function(a){var b=this,c=N.rulesForStyle(a);N.forEachRule(c,function(a){L.nativeShadow?Q.default.normalizeRootSelector(a):Q.default.documentRule(a);L.nativeCssVariables&&(b._ensure(),b._applyShim.transformRule(a))});L.nativeCssVariables?a.textContent=N.toCssText(c):this._documentOwnerStyleInfo.styleRules.rules.push(c)};
|
|
Y.prototype._revalidateApplyShim=function(a){if(L.nativeCssVariables){var b=N.rulesForStyle(a);this._ensure();this._applyShim.transformRules(b);a.textContent=N.toCssText(b)}};Y.prototype.getComputedStyleValue=function(a,b){var c;L.nativeCssVariables||(c=(S.default.get(a)||S.default.get(this._styleOwnerForNode(a))).styleProperties[b]);return(c=c||window.getComputedStyle(a).getPropertyValue(b))?c.trim():""};
|
|
Y.prototype.setElementClass=function(a,b){var c=a.getRootNode();b=b?b.split(/\s/):[];c=c.host&&c.host.localName;if(!c){var d=a.getAttribute("class");if(d)for(var d=d.split(/\s/),e=0;e<d.length;e++)if(d[e]===Q.default.SCOPE_NAME){c=d[e+1];break}}c&&b.push(Q.default.SCOPE_NAME,c);L.nativeCssVariables||(c=S.default.get(a))&&c.scopeSelector&&b.push(T.default.XSCOPE_NAME,c.scopeSelector);N.setElementClassRaw(a,b.join(" "))};Y.prototype._styleInfoForNode=function(a){return S.default.get(a)};
|
|
Y.prototype.flush=Y.prototype.flush;Y.prototype.prepareTemplate=Y.prototype.prepareTemplate;Y.prototype.styleElement=Y.prototype.styleElement;Y.prototype.styleDocument=Y.prototype.styleDocument;Y.prototype.styleSubtree=Y.prototype.styleSubtree;Y.prototype.getComputedStyleValue=Y.prototype.getComputedStyleValue;Y.prototype.setElementClass=Y.prototype.setElementClass;Y.prototype._styleInfoForNode=Y.prototype._styleInfoForNode;Y.prototype.transformCustomStyleForDocument=Y.prototype.transformCustomStyleForDocument;
|
|
Y.prototype.getStyleAst=Y.prototype.getStyleAst;Y.prototype.styleAstToString=Y.prototype.styleAstToString;Y.prototype.flushCustomStyles=Y.prototype.flushCustomStyles;Object.defineProperties(Y.prototype,{nativeShadow:{get:function(){return L.nativeShadow}},nativeCss:{get:function(){return L.nativeCssVariables}}});ed.default=Y;var Z=new ed.default,gd,hd;window.ShadyCSS&&(gd=window.ShadyCSS.ApplyShim,hd=window.ShadyCSS.CustomStyleInterface);
|
|
window.ShadyCSS={ScopingShim:Z,prepareTemplate:function(a,b,c){Z.flushCustomStyles();Z.prepareTemplate(a,b,c)},styleSubtree:function(a,b){Z.flushCustomStyles();Z.styleSubtree(a,b)},styleElement:function(a){Z.flushCustomStyles();Z.styleElement(a)},styleDocument:function(a){Z.flushCustomStyles();Z.styleDocument(a)},getComputedStyleValue:function(a,b){return Z.getComputedStyleValue(a,b)},nativeCss:L.nativeCssVariables,nativeShadow:L.nativeShadow};gd&&(window.ShadyCSS.ApplyShim=gd);
|
|
hd&&(window.ShadyCSS.CustomStyleInterface=hd);
|
|
}).call(self)
|
|
|
|
//# sourceMappingURL=webcomponents-sd-ce.js.map
|