Files
webcomponentsjs/webcomponents-none.js
2017-02-15 22:16:41 -08:00

11 lines
26 KiB
JavaScript

(function(){'use strict';/**
@license
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
*/function e(et){return et=a(et),u(d(et),et)}function a(et){return et.replace(z.comments,'').replace(z.port,'')}function d(et){let tt=new Y;tt.start=0,tt.end=et.length;let st=tt;for(let rt=0,ot=et.length;rt<ot;rt++)if(et[rt]===j){st.rules||(st.rules=[]);let lt=st,nt=lt.rules[lt.rules.length-1]||null;st=new Y,st.start=rt+1,st.parent=lt,st.previous=nt,lt.rules.push(st)}else et[rt]===X&&(st.end=rt+1,st=st.parent||tt);return tt}function u(et,tt){let st=tt.substring(et.start,et.end-1);if(et.parsedCssText=et.cssText=st.trim(),et.parent){let ot=et.previous?et.previous.end:et.parent.start;st=tt.substring(ot,et.start-1),st=y(st),st=st.replace(z.multipleSpaces,' '),st=st.substring(st.lastIndexOf(';')+1);let lt=et.parsedSelector=et.selector=st.trim();et.atRule=0===lt.indexOf('@'),et.atRule?0===lt.indexOf('@media')?et.type=V.MEDIA_RULE:lt.match(z.keyframesRule)&&(et.type=V.KEYFRAMES_RULE,et.keyframesName=et.selector.split(z.multipleSpaces).pop()):0===lt.indexOf(W)?et.type=V.MIXIN_RULE:et.type=V.STYLE_RULE}let rt=et.rules;if(rt)for(let nt,ot=0,lt=rt.length;ot<lt&&(nt=rt[ot]);ot++)u(nt,tt);return et}function y(et){return et.replace(/\\([0-9a-f]{1,6})\s/gi,function(){let tt=arguments[1],st=6-tt.length;for(;st--;)tt='0'+tt;return'\\'+tt})}function S(et,tt,st=''){let rt='';if(et.cssText||et.rules){let ot=et.rules;if(ot&&!f(ot))for(let at,lt=0,nt=ot.length;lt<nt&&(at=ot[lt]);lt++)rt=S(at,tt,rt);else rt=tt?et.cssText:h(et.cssText),rt=rt.trim(),rt&&(rt=' '+rt+'\n')}return rt&&(et.selector&&(st+=et.selector+' '+j+'\n'),st+=rt,et.selector&&(st+=X+'\n\n')),st}function f(et){let tt=et[0];return!!tt&&!!tt.selector&&0===tt.selector.indexOf(W)}function h(et){return et=_(et),g(et)}function _(et){return et.replace(z.customProp,'').replace(z.mixinProp,'')}function g(et){return et.replace(z.mixinApply,'').replace(z.varApply,'')}function C(et){et&&(Z=Z&&!et.nativeCss&&!et.shimcssproperties,J=J&&!et.nativeShadow&&!et.shimshadow)}function E(et,tt){return'string'==typeof et&&(et=e(et)),tt&&A(et,tt),S(et,Z)}function R(et){return!et.__cssRules&&et.textContent&&(et.__cssRules=e(et.textContent)),et.__cssRules}function N(et){return!!et.parent&&et.parent.type===V.KEYFRAMES_RULE}function A(et,tt,st,rt){if(et){let ot=!1,lt=et.type;if(rt&&lt===V.MEDIA_RULE){let at=et.selector.match(re);at&&!window.matchMedia(at[1]).matches&&(ot=!0)}lt===V.STYLE_RULE?tt(et):st&&lt===V.KEYFRAMES_RULE?st(et):lt===V.MIXIN_RULE&&(ot=!0);let nt=et.rules;if(nt&&!ot)for(let it,at=0,pt=nt.length;at<pt&&(it=nt[at]);at++)A(it,tt,st,rt)}}function P(et,tt,st,rt){let ot=T(et,tt);return I(ot,st,rt)}function I(et,tt,st){tt=tt||document.head;let rt=st&&st.nextSibling||tt.firstChild;return ae=et,tt.insertBefore(et,rt)}function T(et,tt){let st=document.createElement('style');return tt&&st.setAttribute('scope',tt),st.textContent=et,st}function b(et){let tt=document.createComment(' Shady DOM styles for '+et+' '),st=ae?ae.nextSibling:null,rt=document.head;return rt.insertBefore(tt,st||rt.firstChild),ae=tt,tt}function O(et,tt){let st=0;for(let rt=tt,ot=et.length;rt<ot;rt++)if('('===et[rt])st++;else if(')'===et[rt]&&0==--st)return rt;return-1}function M(et,tt){let st=et.indexOf('var(');if(-1===st)return tt(et,'','','');let rt=O(et,st+3),ot=et.substring(st+4,rt),lt=et.substring(0,st),nt=M(et.substring(rt+1),tt),at=ot.indexOf(',');if(-1===at)return tt(lt,ot.trim(),'',nt);let pt=ot.substring(0,at).trim(),it=ot.substring(at+1).trim();return tt(lt,pt,it,nt)}function w(et,tt){window.ShadyDOM?window.ShadyDOM.nativeMethods.setAttribute.call(et,'class',tt):et.setAttribute('class',tt)}function L(et){let tt=et.is||et.getAttribute&&et.getAttribute('is')||et.localName,st=et.extends||et.localName!==tt?et.localName:'';return{is:tt,extends:st}}function F(et,tt){let st=parseInt(et/32,10);tt[st]=(tt[st]||0)|1<<et%32}function k(et){let tt=He[et];tt&&D(tt)}function D(et){et._applyShimInvalid=!0}function K(et){return!et._applyShimInvalid}function H(et){return et._validating}function U(et){et._validating||(et._validating=!0,Ue.then(function(){et._applyShimInvalid=!1,et._validating=!1}))}function q(et){Be?Be(et):(!qe&&(qe=new Promise(tt=>{Ye=tt}),'complete'===document.readyState?Ye():document.addEventListener('readystatechange',()=>{'complete'===document.readyState&&Ye()})),qe.then(function(){et&&et()}))}function B(et,tt){for(let st in tt)null===st?et.style.removeProperty(st):et.style.setProperty(st,tt[st])}class Y{constructor(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText='',this.cssText='',this.atRule=!1,this.type=0,this.keyframesName='',this.selector='',this.parsedSelector=''}}const V={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},j='{',X='}',z={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},W='--';let J=!(window.ShadyDOM&&window.ShadyDOM.inUse),Z=!navigator.userAgent.match('AppleWebKit/601')&&window.CSS&&CSS.supports&&CSS.supports('box-shadow','0 0 0 var(--foo)');window.ShadyCSS?C(window.ShadyCSS):window.WebComponents&&C(window.WebComponents.flags);const Q=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\s}])|$)/gi,ee=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,te=/(--[\w-]+)\s*([:,;)]|$)/gi,se=/(animation\s*:)|(animation-name\s*:)/,re=/@media[^(]*(\([^)]*\))/,oe=/\{[^}]*\}/g;let ae=null;const pe='style-scope';class ie{get SCOPE_NAME(){return pe}dom(et,tt,st){et.__styleScoped?et.__styleScoped=null:this._transformDom(et,tt||'',st)}_transformDom(et,tt,st){et.nodeType===Node.ELEMENT_NODE&&this.element(et,tt,st);let rt='template'===et.localName?(et.content||et._content).childNodes:et.children||et.childNodes;if(rt)for(let ot=0;ot<rt.length;ot++)this._transformDom(rt[ot],tt,st)}element(et,tt,st){if(tt)if(et.classList)st?(et.classList.remove(pe),et.classList.remove(tt)):(et.classList.add(pe),et.classList.add(tt));else if(et.getAttribute){let rt=et.getAttribute('class');if(!st){let ot=(rt?rt+' ':'')+pe+' '+tt;w(et,ot)}else if(rt){let ot=rt.replace(pe,'').replace(tt,'');w(et,ot)}}}elementStyles(et,tt,st){let rt=et.__cssBuild,ot='';if(J||'shady'===rt)ot=E(tt,st);else{let{is:lt,extends:nt}=L(et);ot=this.css(tt,lt,nt,st)+'\n\n'}return ot.trim()}css(et,tt,st,rt){let ot=this._calcHostScope(tt,st);tt=this._calcElementScope(tt);let lt=this;return E(et,function(nt){nt.isScoped||(lt.rule(nt,tt,ot),nt.isScoped=!0),rt&&rt(nt,tt,ot)})}_calcElementScope(et){return et?'.'+et:''}_calcHostScope(et,tt){return tt?`[is=${et}]`:et}rule(et,tt,st){this._transformRule(et,this._transformComplexSelector,tt,st)}_transformRule(et,tt,st,rt){et.selector=et.transformedSelector=this._transformRuleCss(et,tt,st,rt)}_transformRuleCss(et,tt,st,rt){let ot=et.selector.split(me);if(!N(et))for(let at,lt=0,nt=ot.length;lt<nt&&(at=ot[lt]);lt++)ot[lt]=tt.call(this,at,st,rt);return ot.join(me)}_transformComplexSelector(et,tt,st){let rt=!1;return et=et.trim(),et=et.replace(de,(ot,lt,nt)=>`:${lt}(${nt.replace(/\s/g,'')})`),et=et.replace(ge,`${fe} $1`),et=et.replace(ye,(ot,lt,nt)=>{if(!rt){let at=this._transformCompoundSelector(nt,lt,tt,st);rt=rt||at.stop,lt=at.combinator,nt=at.value}return lt+nt}),et}_transformCompoundSelector(et,tt,st,rt){let ot=et.indexOf(_e);0<=et.indexOf(fe)?et=this._transformHostSelector(et,rt):0!==ot&&(et=st?this._transformSimpleSelector(et,st):et);let lt=!1;0<=ot&&(tt='',lt=!0);let nt;return lt&&(nt=!0,lt&&(et=et.replace(xe,(at,pt)=>` > ${pt}`))),et=et.replace(Ee,(at,pt,it)=>`[dir="${it}"] ${pt}, ${pt}[dir="${it}"]`),{value:et,combinator:tt,stop:nt}}_transformSimpleSelector(et,tt){let st=et.split(Ne);return st[0]+=tt,st.join(Ne)}_transformHostSelector(et,tt){let st=et.match(Ce),rt=st&&st[2].trim()||'';if(rt){if(!rt[0].match(Se)){let ot=rt.split(Se)[0];return ot===tt?rt:'should_not_match'}return et.replace(Ce,function(ot,lt,nt){return tt+nt})}return et.replace(fe,tt)}documentRule(et){et.selector=et.parsedSelector,this.normalizeRootSelector(et),this._transformRule(et,this._transformDocumentSelector)}normalizeRootSelector(et){et.selector===':root'&&(et.selector='html')}_transformDocumentSelector(et){return et.match(_e)?this._transformComplexSelector(et,ue):this._transformSimpleSelector(et.trim(),ue)}}let de=/:(nth[-\w]+)\(([^)]+)\)/,ue=`:not(.${pe})`,me=',',ye=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,Se=/[[.:#*]/,fe=':host',_e='::slotted',ge=/^(::slotted)/,Ce=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,xe=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Ee=/(.*):dir\((?:(ltr|rtl))\)/,Ne=':';var Pe=new ie;const Ie='__styleInfo';class Te{static get(et){return et?et[Ie]:null}static set(et,tt){return et[Ie]=tt,tt}constructor(et,tt,st,rt,ot,lt){this.styleRules=et||null,this.placeholder=tt||null,this.ownStylePropertyNames=st||[],this.overrideStyleProperties=null,this.elementName=rt||'',this.cssBuild=lt||'',this.typeExtension=ot||'',this.styleProperties=null,this.scopeSelector=null,this.customStyle=null}_getStyleRules(){return this.styleRules}}Te.prototype._getStyleRules=Te.prototype._getStyleRules;const be=(et=>et.matches||et.matchesSelector||et.mozMatchesSelector||et.msMatchesSelector||et.oMatchesSelector||et.webkitMatchesSelector)(window.Element.prototype),Oe=navigator.userAgent.match('Trident'),Me='x-scope';class we{get XSCOPE_NAME(){return Me}decorateStyles(et){let tt=this,st={},rt=[],ot=0;A(et,function(nt){tt.decorateRule(nt),nt.index=ot++,tt.collectPropertiesInCssText(nt.propertyInfo.cssText,st)},function(at){rt.push(at)}),et._keyframes=rt;let lt=[];for(let nt in st)lt.push(nt);return lt}decorateRule(et){if(et.propertyInfo)return et.propertyInfo;let tt={},st={},rt=this.collectProperties(et,st);return rt&&(tt.properties=st,et.rules=null),tt.cssText=this.collectCssText(et),et.propertyInfo=tt,tt}collectProperties(et,tt){let st=et.propertyInfo;if(!st){let rt,lt=et.parsedCssText,nt,at;for(;rt=Q.exec(lt);)nt=(rt[2]||rt[3]).trim(),('inherit'!==nt||'unset'!==nt)&&(tt[rt[1].trim()]=nt),at=!0;return at}else if(st.properties)return Object.assign(tt,st.properties),!0}collectCssText(et){return this.collectConsumingCssText(et.parsedCssText)}collectConsumingCssText(et){return et.replace(oe,'').replace(Q,'')}collectPropertiesInCssText(et,tt){for(let st,rt;st=te.exec(et);)rt=st[1],':'!==st[2]&&(tt[rt]=!0)}reify(et){let tt=Object.getOwnPropertyNames(et);for(let rt,st=0;st<tt.length;st++)rt=tt[st],et[rt]=this.valueForProperty(et[rt],et)}valueForProperty(et,tt){if(et)if(0<=et.indexOf(';'))et=this.valueForProperties(et,tt);else{let st=this;et=M(et,function(ot,lt,nt,at){if(!lt)return ot+at;let pt=st.valueForProperty(tt[lt],tt);return pt&&'initial'!==pt?'apply-shim-inherit'===pt&&(pt='inherit'):pt=st.valueForProperty(tt[nt]||nt,tt)||nt,ot+(pt||'')+at})}return et&&et.trim()||''}valueForProperties(et,tt){let st=et.split(';');for(let ot,lt,rt=0;rt<st.length;rt++)if(ot=st[rt]){if(ee.lastIndex=0,lt=ee.exec(ot),lt)ot=this.valueForProperty(tt[lt[1]],tt);else{let nt=ot.indexOf(':');if(-1!==nt){let at=ot.substring(nt);at=at.trim(),at=this.valueForProperty(at,tt)||at,ot=ot.substring(0,nt)+at}}st[rt]=ot&&ot.lastIndexOf(';')===ot.length-1?ot.slice(0,-1):ot||''}return st.join(';')}applyProperties(et,tt){let st='';et.propertyInfo||this.decorateRule(et),et.propertyInfo.cssText&&(st=this.valueForProperties(et.propertyInfo.cssText,tt)),et.cssText=st}applyKeyframeTransforms(et,tt){let st=et.cssText,rt=et.cssText;if(null==et.hasAnimations&&(et.hasAnimations=se.test(st)),et.hasAnimations){let ot;if(null==et.keyframeNamesToTransform)for(let lt in et.keyframeNamesToTransform=[],tt)ot=tt[lt],rt=ot(st),st!==rt&&(st=rt,et.keyframeNamesToTransform.push(lt));else{for(let lt=0;lt<et.keyframeNamesToTransform.length;++lt)ot=tt[et.keyframeNamesToTransform[lt]],st=ot(st);rt=st}}et.cssText=rt}propertyDataFromStyles(et,tt){let st={},rt=this,ot=[];return A(et,function(lt){lt.propertyInfo||rt.decorateRule(lt);let nt=lt.transformedSelector||lt.parsedSelector;tt&&lt.propertyInfo.properties&&nt&&be.call(tt,nt)&&(rt.collectProperties(lt,st),F(lt.index,ot))},null,!0),{properties:st,key:ot}}whenHostOrRootRule(et,tt,st,rt){if(tt.propertyInfo||this.decorateRule(tt),!!tt.propertyInfo.properties){let ot=L(et),lt=et.is?Pe._calcHostScope(ot.is,ot.extends):'html',nt=tt.parsedSelector,at=':host > *'===nt||'html'===nt,pt=0===nt.indexOf(':host')&&!at;if('shady'===st&&(at=nt===lt+' > *.'+lt||-1!==nt.indexOf('html'),pt=!at&&0===nt.indexOf(lt)),'shadow'===st&&(at=':host > *'===nt||'html'===nt,pt=pt&&!at),at||pt){let it=lt;pt&&(J&&!tt.transformedSelector&&(tt.transformedSelector=Pe._transformRuleCss(tt,Pe._transformComplexSelector,Pe._calcElementScope(ot.is),lt)),it=tt.transformedSelector||lt),rt({selector:it,isHost:pt,isRoot:at})}}}hostAndRootPropertiesForScope(et,tt){let st={},rt={},ot=this,lt=tt&&tt.__cssBuild;return A(tt,function(nt){ot.whenHostOrRootRule(et,nt,lt,function(at){let pt=et._element||et;be.call(pt,at.selector)&&(at.isHost?ot.collectProperties(nt,st):ot.collectProperties(nt,rt))})},null,!0),{rootProps:rt,hostProps:st}}transformStyles(et,tt,st){let rt=this,ot=L(et),lt=Pe._calcHostScope(ot.is,ot.extends),nt=et.extends?'\\'+lt.slice(0,-1)+'\\]':lt,at=new RegExp('(?:^|[^.#[:])'+nt+'($|[.:[\\s>+~])'),pt=Te.get(et).styleRules,it=this._elementKeyframeTransforms(et,pt,st);return Pe.elementStyles(et,pt,function(dt){rt.applyProperties(dt,tt),J||N(dt)||!dt.cssText||(rt.applyKeyframeTransforms(dt,it),rt._scopeSelector(dt,at,lt,st))})}_elementKeyframeTransforms(et,tt,st){let rt=tt._keyframes,ot={};if(!J&&rt)for(let lt=0,nt=rt[lt];lt<rt.length;nt=rt[++lt])this._scopeKeyframes(nt,st),ot[nt.keyframesName]=this._keyframesRuleTransformer(nt);return ot}_keyframesRuleTransformer(et){return function(tt){return tt.replace(et.keyframesNameRx,et.transformedKeyframesName)}}_scopeKeyframes(et,tt){et.keyframesNameRx=new RegExp(et.keyframesName,'g'),et.transformedKeyframesName=et.keyframesName+'-'+tt,et.transformedSelector=et.transformedSelector||et.selector,et.selector=et.transformedSelector.replace(et.keyframesName,et.transformedKeyframesName)}_scopeSelector(et,tt,st,rt){et.transformedSelector=et.transformedSelector||et.selector;let ot=et.transformedSelector,lt='.'+rt,nt=ot.split(',');for(let it,at=0,pt=nt.length;at<pt&&(it=nt[at]);at++)nt[at]=it.match(tt)?it.replace(st,lt):lt+' '+it;et.selector=nt.join(',')}applyElementScopeSelector(et,tt,st){let rt=et.getAttribute('class')||'',ot=rt;st&&(ot=rt.replace(new RegExp('\\s*'+Me+'\\s*'+st+'\\s*','g'),' ')),ot+=(ot?' ':'')+Me+' '+tt,rt!==ot&&w(et,ot)}applyElementStyle(et,tt,st,rt){let ot=rt?rt.textContent||'':this.transformStyles(et,tt,st),lt=Te.get(et),nt=lt.customStyle;return nt&&!J&&nt!==rt&&(nt._useCount--,0>=nt._useCount&&nt.parentNode&&nt.parentNode.removeChild(nt)),J?lt.customStyle?(lt.customStyle.textContent=ot,rt=lt.customStyle):ot&&(rt=P(ot,st,et.shadowRoot,lt.placeholder)):rt?!rt.parentNode&&I(rt,null,lt.placeholder):ot&&(rt=P(ot,st,null,lt.placeholder)),rt&&(rt._useCount=rt._useCount||0,lt.customStyle!=rt&&rt._useCount++,lt.customStyle=rt),Oe&&(rt.textContent=rt.textContent),rt}applyCustomStyle(et,tt){let st=R(et),rt=this;et.textContent=E(st,function(ot){let lt=ot.cssText=ot.parsedCssText;ot.propertyInfo&&ot.propertyInfo.cssText&&(lt=_(lt),ot.cssText=rt.valueForProperties(lt,tt))})}}var Le=new we;let Fe={};const ke=window.customElements;if(ke&&!J){const et=ke.define;ke.define=function(tt,st,rt){return Fe[tt]=b(tt),et.call(ke,tt,st,rt)}}let Ke=function(){};if(!J){let et=lt=>{return lt.classList&&!lt.classList.contains(Pe.SCOPE_NAME)||lt instanceof window.SVGElement&&(!lt.hasAttribute('class')||0>lt.getAttribute('class').indexOf(Pe.SCOPE_NAME))},tt=lt=>{for(let at,nt=0;nt<lt.length;nt++)if(at=lt[nt],at.target!==document.documentElement&&at.target!==document.head){for(let it,pt=0;pt<at.addedNodes.length;pt++)if(it=at.addedNodes[pt],et(it)){let dt=it.getRootNode();if(dt.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let ut=dt.host;if(ut){let{is:ct}=L(ut);Pe.dom(it,ct)}}}for(let it,pt=0;pt<at.removedNodes.length;pt++)if(it=at.removedNodes[pt],it.nodeType===Node.ELEMENT_NODE){let dt;if(it.classList?dt=Array.from(it.classList):it.hasAttribute('class')&&(dt=it.getAttribute('class').split(/\s+/)),void 0!=dt){let ut=dt.indexOf(Pe.SCOPE_NAME);if(0<=ut){let ct=dt[ut+1];ct&&Pe.dom(it,ct,!0)}}}}},st=new MutationObserver(tt),rt=lt=>{st.observe(lt,{childList:!0,subtree:!0})},ot=window.customElements&&!window.customElements.flush;if(ot)rt(document);else{let lt=()=>{rt(document.body)};window.HTMLImports?window.HTMLImports.whenReady(lt):requestAnimationFrame(function(){if('loading'===document.readyState){let nt=function(){lt(),document.removeEventListener('readystatechange',nt)};document.addEventListener('readystatechange',nt)}else lt()})}Ke=function(){tt(st.takeRecords())}}const He={},Ue=Promise.resolve();let qe=null,Be=window.HTMLImports&&window.HTMLImports.whenReady||null,Ye;const Ve='__processedByShadyCSS',je='__seenByShadyCSS';let Xe=null,ze=null;class We{constructor(){this.customStyles=[],this.enqueued=!1}enqueueDocumentValidation(){this.enqueued||!ze||(this.enqueued=!0,q(ze))}addCustomStyle(et){et[je]||(et[je]=!0,this.customStyles.push(et),this.enqueueDocumentValidation())}getStyleForCustomStyle(et){let tt;return tt=et.getStyle?et.getStyle():et,tt}findStyles(){let et=this.customStyles;for(let st,tt=0;tt<et.length;tt++)if(st=et[tt],!st[Ve]){let rt=this.getStyleForCustomStyle(st);if(rt){st[Ve]=!0;let ot=rt.__appliedElement;if(ot)for(let nt,lt=0;lt<rt.attributes.length;lt++)nt=rt.attributes[lt],ot.setAttribute(nt.name,nt.value);Xe&&Xe(ot||rt)}}}}We.prototype.addCustomStyle=We.prototype.addCustomStyle,We.prototype.getStyleForCustomStyle=We.prototype.getStyleForCustomStyle,We.prototype.findStyles=We.prototype.findStyles,Object.defineProperties(We.prototype,{transformCallback:{get(){return Xe},set(et){Xe=et}},validateCallback:{get(){return ze},set(et){let tt=!1;ze||(tt=!0),ze=et,tt&&this.enqueueDocumentValidation()}}});const Ge=new class{constructor(et=100){this.cache={},this.typeMax=et}_validate(et,tt,st){for(let ot,rt=0;rt<st.length;rt++)if(ot=st[rt],et.properties[ot]!==tt[ot])return!1;return!0}store(et,tt,st,rt){let ot=this.cache[et]||[];ot.push({properties:tt,styleElement:st,scopeSelector:rt}),ot.length>this.typeMax&&ot.shift(),this.cache[et]=ot}fetch(et,tt,st){let rt=this.cache[et];if(rt)for(let lt,ot=rt.length-1;0<=ot;ot--)if(lt=rt[ot],this._validate(lt,tt,st))return lt}};class $e{constructor(){this._scopeCounter={},this._documentOwner=document.documentElement;let et=new Y;et.rules=[],this._documentOwnerStyleInfo=Te.set(document.documentElement,new Te(et)),this._elementsHaveApplied=!1,this._applyShim=null,this._customStyleInterface=null,q(()=>{this._ensure()})}flush(){Ke()}_generateScopeSelector(et){let tt=this._scopeCounter[et]=(this._scopeCounter[et]||0)+1;return`${et}-${tt}`}getStyleAst(et){return R(et)}styleAstToString(et){return E(et)}_gatherStyles(et){let tt=et.content.querySelectorAll('style'),st=[];for(let ot,rt=0;rt<tt.length;rt++)ot=tt[rt],st.push(ot.textContent),ot.parentNode.removeChild(ot);return st.join('').trim()}_getCssBuild(et){let tt=et.content.querySelector('style');return tt?tt.getAttribute('css-build')||'':''}prepareTemplate(et,tt,st){if(!et._prepared){et._prepared=!0,et.name=tt,et.extends=st,He[tt]=et;let rt=this._getCssBuild(et),ot=this._gatherStyles(et),lt={is:tt,extends:st,__cssBuild:rt};J||Pe.dom(et.content,tt),this._ensure();let nt=this._applyShim.detectMixin(ot),at=e(ot);nt&&Z&&this._applyShim.transformRules(at,tt),et._styleAst=at,et._cssBuild=rt;let pt=[];if(Z||(pt=Le.decorateStyles(et._styleAst,lt)),!pt.length||Z){let it=J?et.content:null,dt=Fe[tt],ut=this._generateStaticStyle(lt,et._styleAst,it,dt);et._style=ut}et._ownPropertyNames=pt}}_generateStaticStyle(et,tt,st,rt){let ot=Pe.elementStyles(et,tt);if(ot.length)return P(ot,et.is,st,rt)}_prepareHost(et){let lt,nt,at,{is:tt,extends:st}=L(et),rt=Fe[tt],ot=He[tt];return ot&&(lt=ot._styleAst,nt=ot._ownPropertyNames,at=ot._cssBuild),Te.set(et,new Te(lt,rt,nt,tt,st,at))}_ensureApplyShim(){this._applyShim||(window.ShadyCSS.ApplyShim?(this._applyShim=window.ShadyCSS.ApplyShim,this._applyShim.invalidCallback=k):this._applyShim={['detectMixin'](){return!1},['transformRule'](){},['transformRules'](){}})}_ensureCustomStyleInterface(){this._customStyleInterface||(window.ShadyCSS.CustomStyleInterface?(this._customStyleInterface=window.ShadyCSS.CustomStyleInterface,this._customStyleInterface.transformCallback=et=>{this.transformCustomStyleForDocument(et)},this._customStyleInterface.validateCallback=()=>{requestAnimationFrame(()=>{(this._customStyleInterface.enqueued||this._elementsHaveApplied)&&this.flushCustomStyles()})}):this._customStyleInterface={['findStyles'](){},enqueued:!1,['getStyleForCustomStyle'](){return null}})}_ensure(){this._ensureApplyShim(),this._ensureCustomStyleInterface()}flushCustomStyles(){if(this._ensure(),this._customStyleInterface.findStyles(),!!this._customStyleInterface.enqueued){let et=this._customStyleInterface.customStyles;Z?this._revalidateCustomStyleApplyShim(et):(this._updateProperties(this._documentOwner,this._documentOwnerStyleInfo),this._applyCustomStyles(et)),this._customStyleInterface.enqueued=!1,this._elementsHaveApplied&&!Z&&this.styleDocument()}}styleElement(et,tt){let{is:st}=L(et),rt=Te.get(et);if(rt||(rt=this._prepareHost(et)),this._isRootOwner(et)||(this._elementsHaveApplied=!0),tt&&(rt.overrideStyleProperties=rt.overrideStyleProperties||{},Object.assign(rt.overrideStyleProperties,tt)),!Z)this._updateProperties(et,rt),rt.ownStylePropertyNames&&rt.ownStylePropertyNames.length&&this._applyStyleProperties(et,rt);else{rt.overrideStyleProperties&&B(et,rt.overrideStyleProperties);let ot=He[st];if(!ot&&!this._isRootOwner(et))return;if(ot&&ot._style&&!K(ot)){if(H(ot)||(this._ensure(),this._applyShim.transformRules(ot._styleAst,st),ot._style.textContent=Pe.elementStyles(et,rt.styleRules),U(ot)),J){let lt=et.shadowRoot;if(lt){let nt=lt.querySelector('style');nt.textContent=Pe.elementStyles(et,rt.styleRules)}}rt.styleRules=ot._styleAst}}}_styleOwnerForNode(et){let tt=et.getRootNode(),st=tt.host;return st?Te.get(st)?st:this._styleOwnerForNode(st):this._documentOwner}_isRootOwner(et){return et===this._documentOwner}_applyStyleProperties(et,tt){let st=L(et).is,rt=Ge.fetch(st,tt.styleProperties,tt.ownStylePropertyNames),ot=rt&&rt.scopeSelector,lt=rt?rt.styleElement:null,nt=tt.scopeSelector;tt.scopeSelector=ot||this._generateScopeSelector(st);let at=Le.applyElementStyle(et,tt.styleProperties,tt.scopeSelector,lt);return J||Le.applyElementScopeSelector(et,tt.scopeSelector,nt),rt||Ge.store(st,tt.styleProperties,at,tt.scopeSelector),at}_updateProperties(et,tt){let st=this._styleOwnerForNode(et),rt=Te.get(st),ot=rt.styleProperties,lt=Object.create(ot||null),nt=Le.hostAndRootPropertiesForScope(et,tt.styleRules),at=Le.propertyDataFromStyles(rt.styleRules,et),pt=at.properties;Object.assign(lt,nt.hostProps,pt,nt.rootProps),this._mixinOverrideStyles(lt,tt.overrideStyleProperties),Le.reify(lt),tt.styleProperties=lt}_mixinOverrideStyles(et,tt){for(let st in tt){let rt=tt[st];(rt||0===rt)&&(et[st]=rt)}}styleDocument(et){this.styleSubtree(this._documentOwner,et)}styleSubtree(et,tt){(et.shadowRoot||this._isRootOwner(et))&&this.styleElement(et,tt);let st=et.shadowRoot,rt=st&&(st.children||st.childNodes);if(rt)for(let nt,lt=0;lt<rt.length;lt++)nt=rt[lt],this.styleSubtree(nt);let ot=et.children||et.childNodes;if(ot)for(let nt,lt=0;lt<ot.length;lt++)nt=ot[lt],this.styleSubtree(nt)}_revalidateCustomStyleApplyShim(et){for(let tt=0;tt<et.length;tt++){let st=et[tt],rt=this._customStyleInterface.getStyleForCustomStyle(st);rt&&this._revalidateApplyShim(rt)}}_applyCustomStyles(et){for(let tt=0;tt<et.length;tt++){let st=et[tt],rt=this._customStyleInterface.getStyleForCustomStyle(st);rt&&Le.applyCustomStyle(rt,this._documentOwnerStyleInfo.styleProperties)}}transformCustomStyleForDocument(et){let tt=R(et);A(tt,st=>{J?Pe.normalizeRootSelector(st):Pe.documentRule(st),Z&&(this._ensure(),this._applyShim.transformRule(st))}),Z?et.textContent=E(tt):this._documentOwnerStyleInfo.styleRules.rules.push(tt)}_revalidateApplyShim(et){if(Z){let tt=R(et);this._ensure(),this._applyShim.transformRules(tt),et.textContent=E(tt)}}getComputedStyleValue(et,tt){let st;if(!Z){let rt=Te.get(et)||Te.get(this._styleOwnerForNode(et));st=rt.styleProperties[tt]}return st=st||window.getComputedStyle(et).getPropertyValue(tt),st.trim()}setElementClass(et,tt){let st=et.getRootNode(),rt=tt?tt.split(/\s/):[],ot=st.host&&st.host.localName;if(!ot){var lt=et.getAttribute('class');if(lt){let nt=lt.split(/\s/);for(let at=0;at<nt.length;at++)if(nt[at]===Pe.SCOPE_NAME){ot=nt[at+1];break}}}if(ot&&rt.push(Pe.SCOPE_NAME,ot),!Z){let nt=Te.get(et);nt&&nt.scopeSelector&&rt.push(Le.XSCOPE_NAME,nt.scopeSelector)}w(et,rt.join(' '))}_styleInfoForNode(et){return Te.get(et)}}$e.prototype.flush=$e.prototype.flush,$e.prototype.prepareTemplate=$e.prototype.prepareTemplate,$e.prototype.styleElement=$e.prototype.styleElement,$e.prototype.styleDocument=$e.prototype.styleDocument,$e.prototype.styleSubtree=$e.prototype.styleSubtree,$e.prototype.getComputedStyleValue=$e.prototype.getComputedStyleValue,$e.prototype.setElementClass=$e.prototype.setElementClass,$e.prototype._styleInfoForNode=$e.prototype._styleInfoForNode,$e.prototype.transformCustomStyleForDocument=$e.prototype.transformCustomStyleForDocument,$e.prototype.getStyleAst=$e.prototype.getStyleAst,$e.prototype.styleAstToString=$e.prototype.styleAstToString,$e.prototype.flushCustomStyles=$e.prototype.flushCustomStyles,Object.defineProperties($e.prototype,{nativeShadow:{get(){return J}},nativeCss:{get(){return Z}}});const Je=new $e;let Ze,Qe;window.ShadyCSS&&(Ze=window.ShadyCSS.ApplyShim,Qe=window.ShadyCSS.CustomStyleInterface),window.ShadyCSS={ScopingShim:Je,prepareTemplate(et,tt,st){Je.flushCustomStyles(),Je.prepareTemplate(et,tt,st)},styleSubtree(et,tt){Je.flushCustomStyles(),Je.styleSubtree(et,tt)},styleElement(et){Je.flushCustomStyles(),Je.styleElement(et)},styleDocument(et){Je.flushCustomStyles(),Je.styleDocument(et)},getComputedStyleValue(et,tt){return Je.getComputedStyleValue(et,tt)},nativeCss:Z,nativeShadow:J},Ze&&(window.ShadyCSS.ApplyShim=Ze),Qe&&(window.ShadyCSS.CustomStyleInterface=Qe)})();
//# sourceMappingURL=webcomponents-none.js.map