var __spreadArray=this&&this.__spreadArray||function(r,n,a){if(a||arguments.length===2)for(var t=0,e=n.length,v;t<e;t++){if(v||!(t in n)){if(!v)v=Array.prototype.slice.call(n,0,t);v[t]=n[t]}}return r.concat(v||Array.prototype.slice.call(n))};System.register([],(function(r){"use strict";return{execute:function(){var n=function(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};
/**
             * @license
             * Copyright Google Inc. All Rights Reserved.
             *
             * Use of this source code is governed by an MIT-style license that can be
             * found in the LICENSE file at https://angular.io/license
             *
             * This file is a port of shadowCSS from `webcomponents.js` to TypeScript.
             * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
             * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
             */var a=function(r){var n=[];var a=0;r=r.replace(/(\[[^\]]*\])/g,(function(r,t){var e="__ph-".concat(a,"__");n.push(t);a++;return e}));var t=r.replace(/(:nth-[-\w]+)(\([^)]+\))/g,(function(r,t,e){var v="__ph-".concat(a,"__");n.push(e);a++;return t+v}));var e={content:t,placeholders:n};return e};var t=function(r,n){return n.replace(/__ph-(\d+)__/g,(function(n,a){return r[+a]}))};var e="-shadowcsshost";var v="-shadowcssslotted";var u="-shadowcsscontext";var o=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";var i=new RegExp("("+e+o,"gim");var f=new RegExp("("+u+o,"gim");var c=new RegExp("("+v+o,"gim");var s=e+"-no-combinator";var g=/-shadowcsshost-no-combinator([^\s]*)/;var d=[/::shadow/g,/::content/g];var l="([>\\s~+[.,{:][\\s\\S]*)?$";var p=/-shadowcsshost/gim;var h=function(r){return new RegExp("((?<!(^@supports(.*)))|(?<={.*))(".concat(r,"\\b)"),"gim")};var _=h("::slotted");var m=h(":host");var w=h(":host-context");var x=/\/\*\s*[\s\S]*?\*\//g;var S=function(r){return r.replace(x,"")};var $=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;var b=function(r){return r.match($)||[]};var R=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;var E=/([{}])/g;var y=/(^.*?[^\\])??((:+)(.*)|$)/;var A="{";var k="}";var C="%BLOCK%";var L=function(r,n){var a=B(r);var t=0;return a.escapedString.replace(R,(function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}var v=r[2];var u="";var o=r[4];var i="";if(o&&o.startsWith("{"+C)){u=a.blocks[t++];o=o.substring(C.length+1);i="{"}var f={selector:v,content:u};var c=n(f);return"".concat(r[1]).concat(c.selector).concat(r[3]).concat(i).concat(c.content).concat(o)}))};var B=function(r){var n=r.split(E);var a=[];var t=[];var e=0;var v=[];for(var u=0;u<n.length;u++){var o=n[u];if(o===k){e--}if(e>0){v.push(o)}else{if(v.length>0){t.push(v.join(""));a.push(C);v=[]}a.push(o)}if(o===A){e++}}if(v.length>0){t.push(v.join(""));a.push(C)}var i={escapedString:a.join(""),blocks:t};return i};var K=function(r){r=r.replace(w,"$1".concat(u)).replace(m,"$1".concat(e)).replace(_,"$1".concat(v));return r};var O=function(r,n,a){return r.replace(n,(function(){var r=[];for(var n=0;n<arguments.length;n++){r[n]=arguments[n]}if(r[2]){var t=r[2].split(",");var e=[];for(var v=0;v<t.length;v++){var u=t[v].trim();if(!u)break;e.push(a(s,u,r[3]))}return e.join(",")}else{return s+r[3]}}))};var T=function(r,n,a){return r+n.replace(e,"")+a};var M=function(r){return O(r,i,T)};var U=function(r,n,a){if(n.indexOf(e)>-1){return T(r,n,a)}else{return r+n+a+", "+n+" "+r+a}};var j=function(r,n){var a="."+n+" > ";var t=[];r=r.replace(c,(function(){var r=[];for(var n=0;n<arguments.length;n++){r[n]=arguments[n]}if(r[2]){var e=r[2].trim();var v=r[3];var u=a+e+v;var o="";for(var i=r[4]-1;i>=0;i--){var f=r[5][i];if(f==="}"||f===","){break}o=f+o}var c=(o+u).trim();var g="".concat(o.trimEnd()).concat(u.trim()).trim();if(c!==g){var d="".concat(g,", ").concat(c);t.push({orgSelector:c,updatedSelector:d})}return u}else{return s+r[3]}}));return{selectors:t,cssText:r}};var q=function(r){return O(r,f,U)};var z=function(r){return d.reduce((function(r,n){return r.replace(n," ")}),r)};var D=function(r){var n=/\[/g;var a=/\]/g;r=r.replace(n,"\\[").replace(a,"\\]");return new RegExp("^("+r+")"+l,"m")};var F=function(r,n){var a=D(n);return!a.test(r)};var G=function(r,n){return r.replace(y,(function(r,a,t,e,v){if(a===void 0){a=""}if(e===void 0){e=""}if(v===void 0){v=""}return a+n+e+v}))};var H=function(r,n,a){p.lastIndex=0;if(p.test(r)){var t=".".concat(a);return r.replace(g,(function(r,n){return G(n,t)})).replace(p,t+" ")}return n+" "+r};var I=function(r,n,e){var v=/\[is=([^\]]*)\]/g;n=n.replace(v,(function(r){var n=[];for(var a=1;a<arguments.length;a++){n[a-1]=arguments[a]}return n[0]}));var u="."+n;var o=function(r){var a=r.trim();if(!a){return""}if(r.indexOf(s)>-1){a=H(r,n,e)}else{var t=r.replace(p,"");if(t.length>0){a=G(t,u)}}return a};var i=a(r);r=i.content;var f="";var c=0;var g;var d=/( |>|\+|~(?!=))\s*/g;var l=r.indexOf(s)>-1;var h=!l;while((g=d.exec(r))!==null){var _=g[1];var m=r.slice(c,g.index).trim();h=h||m.indexOf(s)>-1;var w=h?o(m):m;f+="".concat(w," ").concat(_," ");c=d.lastIndex}var x=r.substring(c);h=h||x.indexOf(s)>-1;f+=h?o(x):x;return t(i.placeholders,f)};var J=function(r,n,a,t){return r.split(",").map((function(r){if(t&&r.indexOf("."+t)>-1){return r.trim()}if(F(r,n)){return I(r,n,a).trim()}else{return r.trim()}})).join(", ")};var N=function(r,n,a,t,e){return L(r,(function(r){var v=r.selector;var u=r.content;if(r.selector[0]!=="@"){v=J(r.selector,n,a,t)}else if(r.selector.startsWith("@media")||r.selector.startsWith("@supports")||r.selector.startsWith("@page")||r.selector.startsWith("@document")){u=N(r.content,n,a,t,e)}var o={selector:v.replace(/\s{2,}/g," ").trim(),content:u};return o}))};var P=function(r,n,a,t,e){r=K(r);r=M(r);r=q(r);var v=j(r,t);r=v.cssText;r=z(r);if(n){r=N(r,n,a,t,e)}r=Q(r,a);r=r.replace(/>\s*\*\s+([^{, ]+)/gm," $1 ");return{cssText:r.trim(),slottedSelectors:v.selectors.map((function(r){return{orgSelector:Q(r.orgSelector,a),updatedSelector:Q(r.updatedSelector,a)}}))}};var Q=function(r,n){return r.replace(/-shadowcsshost-no-combinator/g,".".concat(n))};var V=r("scopeCss",(function(r,a,t){var e=a+"-h";var v=a+"-s";var u=b(r);r=S(r);var o=[];if(t){var i=function(r){var n="/*!@___".concat(o.length,"___*/");var a="/*!@".concat(r.selector,"*/");o.push({placeholder:n,comment:a});r.selector=n+r.selector;return r};r=L(r,(function(r){if(r.selector[0]!=="@"){return i(r)}else if(r.selector.startsWith("@media")||r.selector.startsWith("@supports")||r.selector.startsWith("@page")||r.selector.startsWith("@document")){r.content=L(r.content,i);return r}return r}))}var f=P(r,a,e,v,t);r=__spreadArray([f.cssText],u,true).join("\n");if(t){o.forEach((function(n){var a=n.placeholder,t=n.comment;r=r.replace(a,t)}))}f.slottedSelectors.forEach((function(a){var t=new RegExp(n(a.orgSelector),"g");r=r.replace(t,a.updatedSelector)}));return r}))}}}));
//# sourceMappingURL=shadow-css-cf2fff06.system.js.map