UNPKG

activator-oce-exporter

Version:

Extract Activator binder and convert it to valid OCE mono pacakge

56 lines (53 loc) 20.9 kB
(function(){/* 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 */ 'use strict';var l,aa="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function m(){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 n(a){a=a.replace(ba,"").replace(ca,"");var b=da,c=a,e=new m;e.start=0;e.end=c.length;for(var d=e,f=0,h=c.length;f<h;f++)if("{"===c[f]){d.rules||(d.rules=[]);var g=d,k=g.rules[g.rules.length-1]||null;d=new m;d.start=f+1;d.parent=g;d.previous=k;g.rules.push(d)}else"}"===c[f]&&(d.end=f+1,d=d.parent||e);return b(e,a)} function da(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=ea(c),c=c.replace(fa," "),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=ha:c.match(ia)&&(a.type=p,a.keyframesName=a.selector.split(fa).pop()):a.type=0===c.indexOf("--")?ja:ka);if(c=a.rules)for(var e=0,d=c.length,f;e<d&&(f=c[e]);e++)da(f,b); return a}function ea(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 la(a,b,c){c=void 0===c?"":c;var e="";if(a.cssText||a.rules){var d=a.rules,f;if(f=d)f=d[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var h=d.length,g;f<h&&(g=d[f]);f++)e=la(g,b,e)}else b?b=a.cssText:(b=a.cssText,b=b.replace(ma,"").replace(na,""),b=b.replace(oa,"").replace(pa,"")),(e=b.trim())&&(e=" "+e+"\n")}e&&(a.selector&&(c+=a.selector+" {\n"),c+=e,a.selector&&(c+="}\n\n"));return c} var ka=1,p=7,ha=4,ja=1E3,ba=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ca=/@import[^;]*;/gim,ma=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,na=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,oa=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,pa=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,ia=/^@[^\s]*keyframes/,fa=/\s+/g;var q=!(window.ShadyDOM&&window.ShadyDOM.inUse),r;function qa(a){r=a&&a.shimcssproperties?!1:q||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?r=window.ShadyCSS.nativeCss:window.ShadyCSS?(qa(window.ShadyCSS),window.ShadyCSS=void 0):qa(window.WebComponents&&window.WebComponents.flags);var v=r;var w=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,x=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,ra=/(--[\w-]+)\s*([:,;)]|$)/gi,sa=/(animation\s*:)|(animation-name\s*:)/,ta=/@media\s(.*)/,ua=/\{[^}]*\}/g;var va=new Set;function y(a,b){if(!a)return"";"string"===typeof a&&(a=n(a));b&&z(a,b);return la(a,v)}function A(a){!a.__cssRules&&a.textContent&&(a.__cssRules=n(a.textContent));return a.__cssRules||null}function wa(a){return!!a.parent&&a.parent.type===p}function z(a,b,c,e){if(a){var d=!1,f=a.type;if(e&&f===ha){var h=a.selector.match(ta);h&&(window.matchMedia(h[1]).matches||(d=!0))}f===ka?b(a):c&&f===p?c(a):f===ja&&(d=!0);if((a=a.rules)&&!d){d=0;f=a.length;for(var g;d<f&&(g=a[d]);d++)z(g,b,c,e)}}} function B(a,b,c,e){var d=document.createElement("style");b&&d.setAttribute("scope",b);d.textContent=a;xa(d,c,e);return d}var C=null;function ya(a){a=document.createComment(" Shady DOM styles for "+a+" ");var b=document.head;b.insertBefore(a,(C?C.nextSibling:null)||b.firstChild);return C=a}function xa(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);C?a.compareDocumentPosition(C)===Node.DOCUMENT_POSITION_PRECEDING&&(C=a):C=a} function D(a,b){for(var c=0,e=a.length;b<e;b++)if("("===a[b])c++;else if(")"===a[b]&&0===--c)return b;return-1}function za(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");var e=D(a,c+3),d=a.substring(c+4,e);c=a.substring(0,c);a=za(a.substring(e+1),b);e=d.indexOf(",");return-1===e?b(c,d.trim(),"",a):b(c,d.substring(0,e).trim(),d.substring(e+1).trim(),a)}function E(a,b){q?a.setAttribute("class",b):window.ShadyDOM.nativeMethods.setAttribute.call(a,"class",b)} function F(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,u:c}}function Aa(a){for(var b=[],c="",e=0;0<=e&&e<a.length;e++)if("("===a[e]){var d=D(a,e);c+=a.slice(e,d+1);e=d}else","===a[e]?(b.push(c),c=""):c+=a[e];c&&b.push(c);return b} function G(a){if(void 0===a.a){var b=a.getAttribute("css-build");if(b)a.a=b;else{a:{b="template"===a.localName?a.content.firstChild:a.firstChild;if(b instanceof Comment&&(b=b.textContent.trim().split(":"),"css-build"===b[0])){b=b[1];break a}b=""}if(""!==b){var c="template"===a.localName?a.content.firstChild:a.firstChild;c.parentNode.removeChild(c)}a.a=b}}return a.a||""};function H(){}function Ba(a,b){I(J,a,function(a){K(a,b||"")})}function I(a,b,c){b.nodeType===Node.ELEMENT_NODE&&c(b);if(b="template"===b.localName?(b.content||b.S||b).childNodes:b.children||b.childNodes)for(var e=0;e<b.length;e++)I(a,b[e],c)} function K(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 e=a.getAttribute(Ca);c?e&&(b=e.replace("style-scope","").replace(b,""),E(a,b)):E(a,(e?e+" ":"")+"style-scope "+b)}}function Da(a,b,c){I(J,a,function(a){K(a,b,!0);K(a,c)})}function Ea(a,b){I(J,a,function(a){K(a,b||"",!0)})} function L(a,b,c,e){var d=J;q||"shady"===(void 0===e?"":e)?b=y(b,c):(a=F(a),b=Fa(d,b,a.is,a.u,c)+"\n\n");return b.trim()}function Fa(a,b,c,e,d){var f=Ga(c,e);c=c?Ha+c:"";return y(b,function(b){b.c||(b.selector=b.h=Ia(a,b,a.b,c,f),b.c=!0);d&&d(b,c,f)})}function Ga(a,b){return b?"[is="+a+"]":a}function Ia(a,b,c,e,d){var f=Aa(b.selector);if(!wa(b)){b=0;for(var h=f.length,g;b<h&&(g=f[b]);b++)f[b]=c.call(a,g,e,d)}return f.filter(function(a){return!!a}).join(Ja)} function Ka(a){return a.replace(La,function(a,c,e){-1<e.indexOf("+")?e=e.replace(/\+/g,"___"):-1<e.indexOf("___")&&(e=e.replace(/___/g,"+"));return":"+c+"("+e+")"})}function Ma(a){for(var b=[],c;c=a.match(Na);){var e=c.index,d=D(a,e);if(-1===d)throw Error(c.input+" selector missing ')'");c=a.slice(e,d+1);a=a.replace(c,"\ue000");b.push(c)}return{B:a,matches:b}}function Oa(a,b){var c=a.split("\ue000");return b.reduce(function(a,b,f){return a+b+c[f+1]},c[0])} H.prototype.b=function(a,b,c){var e=!1;a=a.trim();var d=La.test(a);d&&(a=a.replace(La,function(a,b,c){return":"+b+"("+c.replace(/\s/g,"")+")"}),a=Ka(a));var f=Na.test(a);if(f){var h=Ma(a);a=h.B;h=h.matches}a=a.replace(Pa,M+" $1");a=a.replace(Qa,function(a,d,f){e||(a=Ra(f,d,b,c),e=e||a.stop,d=a.G,f=a.value);return d+f});f&&(a=Oa(a,h));d&&(a=Ka(a));return a}; function Ra(a,b,c,e){var d=a.indexOf(Sa);0<=a.indexOf(M)?a=Ta(a,e):0!==d&&(a=c?Ua(a,c):a);c=!1;0<=d&&(b="",c=!0);if(c){var f=!0;c&&(a=a.replace(Va,function(a,b){return" > "+b}))}a=a.replace(Wa,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,G:b,stop:f}}function Ua(a,b){a=a.split(Xa);a[0]+=b;return a.join(Xa)} function Ta(a,b){var c=a.match(Ya);return(c=c&&c[2].trim()||"")?c[0].match(Za)?a.replace(Ya,function(a,c,f){return b+f}):c.split(Za)[0]===b?c:$a:a.replace(M,b)}function ab(a){a.selector===bb&&(a.selector="html")}H.prototype.c=function(a){return a.match(M)?"":a.match(Sa)?this.b(a,cb):Ua(a.trim(),cb)};aa.Object.defineProperties(H.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}}); var La=/:(nth[-\w]+)\(([^)]+)\)/,cb=":not(.style-scope)",Ja=",",Qa=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Za=/[[.:#*]/,M=":host",bb=":root",Sa="::slotted",Pa=new RegExp("^("+Sa+")"),Ya=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Va=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Wa=/(.*):dir\((?:(ltr|rtl))\)/,Ha=".",Xa=":",Ca="class",$a="should_not_match",Na=/:(?:matches|any|-(?:webkit|moz)-any)/,J=new H;function N(a,b,c,e,d){this.l=a||null;this.b=b||null;this.c=c||[];this.o=null;this.v=d||"";this.u=e||"";this.a=this.i=this.m=null}function O(a){return a?a.__styleInfo:null}function db(a,b){return a.__styleInfo=b}N.prototype.g=function(){return this.l};N.prototype._getStyleRules=N.prototype.g;function eb(a){var b=this.matches||this.matchesSelector||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector;return b&&b.call(this,a)}var fb=navigator.userAgent.match("Trident");function gb(){}function hb(a){var b={},c=[],e=0;z(a,function(a){P(a);a.index=e++;a=a.f.cssText;for(var c;c=ra.exec(a);){var d=c[1];":"!==c[2]&&(b[d]=!0)}},function(a){c.push(a)});a.b=c;a=[];for(var d in b)a.push(d);return a} function P(a){if(!a.f){var b={},c={};R(a,c)&&(b.j=c,a.rules=null);b.cssText=a.parsedCssText.replace(ua,"").replace(w,"");a.f=b}}function R(a,b){var c=a.f;if(c){if(c.j)return Object.assign(b,c.j),!0}else{c=a.parsedCssText;for(var e;a=w.exec(c);){e=(a[2]||a[3]).trim();if("inherit"!==e||"unset"!==e)b[a[1].trim()]=e;e=!0}return e}} function S(a,b,c){b&&(b=0<=b.indexOf(";")?ib(a,b,c):za(b,function(b,d,f,h){if(!d)return b+h;(d=S(a,c[d],c))&&"initial"!==d?"apply-shim-inherit"===d&&(d="inherit"):d=S(a,c[f]||f,c)||f;return b+(d||"")+h}));return b&&b.trim()||""} function ib(a,b,c){b=b.split(";");for(var e=0,d,f;e<b.length;e++)if(d=b[e]){x.lastIndex=0;if(f=x.exec(d))d=S(a,c[f[1]],c);else if(f=d.indexOf(":"),-1!==f){var h=d.substring(f);h=h.trim();h=S(a,h,c)||h;d=d.substring(0,f)+h}b[e]=d&&d.lastIndexOf(";")===d.length-1?d.slice(0,-1):d||""}return b.join(";")} function jb(a,b){var c={},e=[];z(a,function(a){a.f||P(a);var d=a.h||a.parsedSelector;b&&a.f.j&&d&&eb.call(b,d)&&(R(a,c),a=a.index,d=parseInt(a/32,10),e[d]=(e[d]||0)|1<<a%32)},null,!0);return{j:c,key:e}} function kb(a,b,c,e){b.f||P(b);if(b.f.j){var d=F(a);a=d.is;d=d.u;d=a?Ga(a,d):"html";var f=b.parsedSelector,h=":host > *"===f||"html"===f,g=0===f.indexOf(":host")&&!h;"shady"===c&&(h=f===d+" > *."+d||-1!==f.indexOf("html"),g=!h&&0===f.indexOf(d));if(h||g)c=d,g&&(b.h||(b.h=Ia(J,b,J.b,a?Ha+a:"",d)),c=b.h||d),e({B:c,K:g,T:h})}}function lb(a,b,c){var e={},d={};z(b,function(b){kb(a,b,c,function(c){eb.call(a.U||a,c.B)&&(c.K?R(b,e):R(b,d))})},null,!0);return{L:d,J:e}} function mb(a,b,c,e){var d=F(b),f=Ga(d.is,d.u),h=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])"),g=O(b);d=g.l;g=g.v;var k=nb(d,e);return L(b,d,function(b){var d="";b.f||P(b);b.f.cssText&&(d=ib(a,b.f.cssText,c));b.cssText=d;if(!q&&!wa(b)&&b.cssText){var g=d=b.cssText;null==b.C&&(b.C=sa.test(d));if(b.C)if(null==b.A){b.A=[];for(var t in k)g=k[t],g=g(d),d!==g&&(d=g,b.A.push(t))}else{for(t=0;t<b.A.length;++t)g=k[b.A[t]],d=g(d);g=d}b.cssText=g;b.h=b.h||b.selector;d= "."+e;t=Aa(b.h);g=0;for(var u=t.length,Q;g<u&&(Q=t[g]);g++)t[g]=Q.match(h)?Q.replace(f,d):d+" "+Q;b.selector=t.join(",")}},g)}function nb(a,b){a=a.b;var c={};if(!q&&a)for(var e=0,d=a[e];e<a.length;d=a[++e]){var f=d,h=b;f.g=new RegExp("\\b"+f.keyframesName+"(?!\\B|-)","g");f.a=f.keyframesName+"-"+h;f.h=f.h||f.selector;f.selector=f.h.replace(f.keyframesName,f.a);c[d.keyframesName]=ob(d)}return c}function ob(a){return function(b){return b.replace(a.g,a.a)}} function pb(a,b){var c=T,e=A(a);a.textContent=y(e,function(a){var d=a.cssText=a.parsedCssText;a.f&&a.f.cssText&&(d=d.replace(ma,"").replace(na,""),a.cssText=ib(c,d,b))})}aa.Object.defineProperties(gb.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var T=new gb;var U={},V=window.customElements;if(V&&!q){var qb=V.define;V.define=function(a,b,c){U[a]||(U[a]=ya(a));qb.call(V,a,b,c)}};function rb(){this.cache={}}rb.prototype.store=function(a,b,c,e){var d=this.cache[a]||[];d.push({j:b,styleElement:c,i:e});100<d.length&&d.shift();this.cache[a]=d};function sb(){}function tb(a){var b=[];a.classList?b=Array.from(a.classList):a instanceof window.SVGElement&&a.hasAttribute("class")&&(b=a.getAttribute("class").split(/\s+/));a=b;b=a.indexOf(J.a);return-1<b?a[b+1]:""}function ub(a){var b=a.getRootNode();return b===a||b===a.ownerDocument?"":(a=b.host)?F(a).is:""} function vb(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.target!==document.documentElement&&c.target!==document.head)for(var e=0;e<c.addedNodes.length;e++){var d=c.addedNodes[e];if(d.nodeType===Node.ELEMENT_NODE){var f=d.getRootNode(),h=tb(d);if(h&&f===d.ownerDocument&&("style"!==d.localName&&"template"!==d.localName||""===G(d)))Ea(d,h);else if(f instanceof ShadowRoot)for(f=ub(d),f!==h&&Da(d,h,f),d=window.ShadyDOM.nativeMethods.querySelectorAll.call(d,":not(."+J.a+")"),h=0;h<d.length;h++){f=d[h]; var g=ub(f);g&&K(f,g)}}}}} if(!(q||window.ShadyDOM&&window.ShadyDOM.handlesDynamicScoping)){var wb=new MutationObserver(vb),xb=function(a){wb.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)xb(document);else{var yb=function(){xb(document.body)};window.HTMLImports?window.HTMLImports.whenReady(yb):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){yb();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange", a)}else yb()})}sb=function(){vb(wb.takeRecords())}}var zb=sb;var W={};var Ab=Promise.resolve();function Bb(a){if(a=W[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function Cb(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function Db(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.c||(a.c=!0,Ab.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.c=!1}))};var Eb=new rb;function X(){this.w={};this.c=document.documentElement;var a=new m;a.rules=[];this.g=db(this.c,new N(a));this.s=!1;this.b=this.a=null}l=X.prototype;l.flush=function(){zb()};l.I=function(a){return A(a)};l.P=function(a){return y(a)};l.prepareTemplate=function(a,b,c){this.prepareTemplateDom(a,b);this.prepareTemplateStyles(a,b,c)}; l.prepareTemplateStyles=function(a,b,c){if(!a.w){q||U[b]||(U[b]=ya(b));a.w=!0;a.name=b;a.extends=c;W[b]=a;var e=G(a);var d=[];for(var f=a.content.querySelectorAll("style"),h=0;h<f.length;h++){var g=f[h];if(g.hasAttribute("shady-unscoped")){if(!q){var k=g.textContent;va.has(k)||(va.add(k),k=g.cloneNode(!0),document.head.appendChild(k));g.parentNode.removeChild(g)}}else d.push(g.textContent),g.parentNode.removeChild(g)}d=d.join("").trim();c={is:b,extends:c};Y(this);if(f=""===G(a))f=x.test(d)||w.test(d), x.lastIndex=0,w.lastIndex=0;d=n(d);f&&v&&this.a&&this.a.transformRules(d,b);a._styleAst=d;d=[];v||(d=hb(a._styleAst));if(!d.length||v)f=q?a.content:null,b=U[b]||null,e=L(c,a._styleAst,null,e),e=e.length?B(e,c.is,f,b):void 0,a.b=e;a.s=d}};l.prepareTemplateDom=function(a,b){var c=G(a);q||"shady"===c||a.g||(a.g=!0,Ba(a.content,b))}; function Fb(a){!a.b&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(a.b=window.ShadyCSS.CustomStyleInterface,a.b.transformCallback=function(b){a.D(b)},a.b.validateCallback=function(){requestAnimationFrame(function(){(a.b.enqueued||a.s)&&a.flushCustomStyles()})})}function Y(a){!a.a&&window.ShadyCSS&&window.ShadyCSS.ApplyShim&&(a.a=window.ShadyCSS.ApplyShim,a.a.invalidCallback=Bb);Fb(a)} l.flushCustomStyles=function(){Y(this);if(this.b){var a=this.b.processStyles();if(this.b.enqueued){if(v)for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);if(c&&v&&this.a){var e=A(c);Y(this);this.a.transformRules(e);c.textContent=y(e)}}else for(Gb(this,this.c,this.g),b=0;b<a.length;b++)(c=this.b.getStyleForCustomStyle(a[b]))&&pb(c,this.g.m);this.b.enqueued=!1;this.s&&!v&&this.styleDocument()}}}; l.styleElement=function(a,b){var c=O(a);if(!c){var e=F(a);c=e.is;e=e.u;var d=U[c]||null;c=W[c];if(c){var f=c._styleAst;var h=c.s;var g=G(c)}f=new N(f,d,h,e,g);c&&db(a,f);c=f}a!==this.c&&(this.s=!0);b&&(c.o=c.o||{},Object.assign(c.o,b));if(v){b=c;f=F(a).is;if(b.o){h=b.o;for(var k in h)null===k?a.style.removeProperty(k):a.style.setProperty(k,h[k])}if(!(!(k=W[f])&&a!==this.c||k&&""!==G(k))&&k&&k.b&&!Cb(k)){if(Cb(k)||k._applyShimValidatingVersion!==k._applyShimNextVersion)Y(this),this.a&&this.a.transformRules(k._styleAst, f),k.b.textContent=L(a,b.l),Db(k);q&&(f=a.shadowRoot)&&(f=f.querySelector("style"))&&(f.textContent=L(a,b.l));b.l=k._styleAst}}else if(k=c,this.flush(),Gb(this,a,k),k.c&&k.c.length){b=F(a).is;a:{if(f=Eb.cache[b])for(h=f.length-1;0<=h;h--){g=f[h];b:{c=k.c;for(e=0;e<c.length;e++)if(d=c[e],g.j[d]!==k.m[d]){c=!1;break b}c=!0}if(c){f=g;break a}}f=void 0}c=f?f.styleElement:null;h=k.i;(g=f&&f.i)||(g=this.w[b]=(this.w[b]||0)+1,g=b+"-"+g);k.i=g;g=k.i;e=T;e=c?c.textContent||"":mb(e,a,k.m,g);d=O(a);var u=d.a; u&&!q&&u!==c&&(u._useCount--,0>=u._useCount&&u.parentNode&&u.parentNode.removeChild(u));q?d.a?(d.a.textContent=e,c=d.a):e&&(c=B(e,g,a.shadowRoot,d.b)):c?c.parentNode||(fb&&-1<e.indexOf("@media")&&(c.textContent=e),xa(c,null,d.b)):e&&(c=B(e,g,null,d.b));c&&(c._useCount=c._useCount||0,d.a!=c&&c._useCount++,d.a=c);g=c;q||(c=k.i,d=e=a.getAttribute("class")||"",h&&(d=e.replace(new RegExp("\\s*x-scope\\s*"+h+"\\s*","g")," ")),d+=(d?" ":"")+"x-scope "+c,e!==d&&E(a,d));f||Eb.store(b,k.m,g,k.i)}}; function Hb(a,b){return(b=b.getRootNode().host)?O(b)?b:Hb(a,b):a.c}function Gb(a,b,c){a=Hb(a,b);var e=O(a);a=Object.create(e.m||null);var d=lb(b,c.l,c.v);b=jb(e.l,b).j;Object.assign(a,d.J,b,d.L);b=c.o;for(var f in b)if((d=b[f])||0===d)a[f]=d;f=T;b=Object.getOwnPropertyNames(a);for(d=0;d<b.length;d++)e=b[d],a[e]=S(f,a[e],a);c.m=a}l.styleDocument=function(a){this.styleSubtree(this.c,a)}; l.styleSubtree=function(a,b){var c=a.shadowRoot;(c||a===this.c)&&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])}; l.D=function(a){var b=this,c=A(a),e=G(a);e!==this.g.v&&(this.g.v=e);z(c,function(a){if(q)ab(a);else{var c=J;a.selector=a.parsedSelector;ab(a);a.selector=a.h=Ia(c,a,c.c,void 0,void 0)}v&&""===e&&(Y(b),b.a&&b.a.transformRule(a))});v?a.textContent=y(c):this.g.l.rules.push(c)};l.getComputedStyleValue=function(a,b){var c;v||(c=(O(a)||O(Hb(this,a))).m[b]);return(c=c||window.getComputedStyle(a).getPropertyValue(b))?c.trim():""}; l.O=function(a,b){var c=a.getRootNode();b=b?b.split(/\s/):[];c=c.host&&c.host.localName;if(!c){var e=a.getAttribute("class");if(e){e=e.split(/\s/);for(var d=0;d<e.length;d++)if(e[d]===J.a){c=e[d+1];break}}}c&&b.push(J.a,c);v||(c=O(a))&&c.i&&b.push(T.a,c.i);E(a,b.join(" "))};l.F=function(a){return O(a)};l.N=function(a,b){K(a,b)};l.R=function(a,b){K(a,b,!0)};l.M=function(a){return ub(a)};l.H=function(a){return tb(a)};X.prototype.flush=X.prototype.flush;X.prototype.prepareTemplate=X.prototype.prepareTemplate; X.prototype.styleElement=X.prototype.styleElement;X.prototype.styleDocument=X.prototype.styleDocument;X.prototype.styleSubtree=X.prototype.styleSubtree;X.prototype.getComputedStyleValue=X.prototype.getComputedStyleValue;X.prototype.setElementClass=X.prototype.O;X.prototype._styleInfoForNode=X.prototype.F;X.prototype.transformCustomStyleForDocument=X.prototype.D;X.prototype.getStyleAst=X.prototype.I;X.prototype.styleAstToString=X.prototype.P;X.prototype.flushCustomStyles=X.prototype.flushCustomStyles; X.prototype.scopeNode=X.prototype.N;X.prototype.unscopeNode=X.prototype.R;X.prototype.scopeForNode=X.prototype.M;X.prototype.currentScopeForNode=X.prototype.H;Object.defineProperties(X.prototype,{nativeShadow:{get:function(){return q}},nativeCss:{get:function(){return v}}});var Z=new X,Ib,Jb;window.ShadyCSS&&(Ib=window.ShadyCSS.ApplyShim,Jb=window.ShadyCSS.CustomStyleInterface); window.ShadyCSS={ScopingShim:Z,prepareTemplate:function(a,b,c){Z.flushCustomStyles();Z.prepareTemplate(a,b,c)},prepareTemplateDom:function(a,b){Z.prepareTemplateDom(a,b)},prepareTemplateStyles:function(a,b,c){Z.flushCustomStyles();Z.prepareTemplateStyles(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)},flushCustomStyles:function(){Z.flushCustomStyles()}, getComputedStyleValue:function(a,b){return Z.getComputedStyleValue(a,b)},nativeCss:v,nativeShadow:q};Ib&&(window.ShadyCSS.ApplyShim=Ib);Jb&&(window.ShadyCSS.CustomStyleInterface=Jb);}).call(this); //# sourceMappingURL=scoping-shim.min.js.map