@angular/core 18.2.7 → 18.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/esm2022/src/event_emitter.mjs +4 -1
  2. package/esm2022/src/interface/type.mjs +1 -1
  3. package/esm2022/src/linker/view_ref.mjs +1 -1
  4. package/esm2022/src/platform/bootstrap.mjs +8 -4
  5. package/esm2022/src/platform/platform_ref.mjs +6 -2
  6. package/esm2022/src/render3/after_render/manager.mjs +4 -1
  7. package/esm2022/src/render3/component_ref.mjs +1 -1
  8. package/esm2022/src/render3/definition.mjs +1 -1
  9. package/esm2022/src/render3/features/input_transforms_feature.mjs +1 -1
  10. package/esm2022/src/render3/view_ref.mjs +1 -1
  11. package/esm2022/src/version.mjs +1 -1
  12. package/esm2022/testing/src/application_error_handler.mjs +3 -3
  13. package/esm2022/testing/src/component_fixture.mjs +1 -1
  14. package/esm2022/testing/src/logger.mjs +3 -3
  15. package/fesm2022/core.mjs +21 -7
  16. package/fesm2022/core.mjs.map +1 -1
  17. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  18. package/fesm2022/primitives/signals.mjs +1 -1
  19. package/fesm2022/rxjs-interop.mjs +1 -1
  20. package/fesm2022/testing.mjs +4 -4
  21. package/fesm2022/testing.mjs.map +1 -1
  22. package/index.d.ts +4 -20
  23. package/package.json +1 -1
  24. package/primitives/event-dispatch/index.d.ts +1 -1
  25. package/primitives/signals/index.d.ts +1 -1
  26. package/rxjs-interop/index.d.ts +1 -1
  27. package/schematics/migrations/after-render-phase/bundle.js +64 -22
  28. package/schematics/migrations/http-providers/bundle.js +64 -22
  29. package/schematics/migrations/invalid-two-way-bindings/bundle.js +64 -22
  30. package/schematics/ng-generate/control-flow-migration/bundle.js +64 -22
  31. package/schematics/ng-generate/inject-migration/bundle.js +64 -22
  32. package/schematics/ng-generate/route-lazy-loading/bundle.js +64 -22
  33. package/schematics/ng-generate/standalone-migration/bundle.js +107 -43
  34. package/testing/index.d.ts +3 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.2.7
2
+ * @license Angular v18.2.9
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -7272,12 +7272,6 @@ declare const MOVED_VIEWS = 9;
7272
7272
 
7273
7273
  declare const MULTIPLIER = "x";
7274
7274
 
7275
- declare type Mutable<T extends {
7276
- [x: string]: any;
7277
- }, K extends string> = {
7278
- [P in K]: T[P];
7279
- };
7280
-
7281
7275
  declare const NATIVE = 7;
7282
7276
 
7283
7277
  declare const NEXT = 4;
@@ -11983,16 +11977,6 @@ export declare abstract class ViewRef extends ChangeDetectorRef {
11983
11977
  abstract onDestroy(callback: Function): void;
11984
11978
  }
11985
11979
 
11986
- /**
11987
- * Interface for tracking root `ViewRef`s in `ApplicationRef`.
11988
- *
11989
- * NOTE: Importing `ApplicationRef` here directly creates circular dependency, which is why we have
11990
- * a subset of the `ApplicationRef` interface `ViewRefTracker` here.
11991
- */
11992
- declare interface ViewRefTracker {
11993
- detachView(viewRef: ViewRef): void;
11994
- }
11995
-
11996
11980
  /**
11997
11981
  * A `Signal` with a value that can be mutated via a setter interface.
11998
11982
  */
@@ -14260,7 +14244,7 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorR
14260
14244
  checkNoChanges(): void;
14261
14245
  attachToViewContainerRef(): void;
14262
14246
  detachFromAppRef(): void;
14263
- attachToAppRef(appRef: ViewRefTracker): void;
14247
+ attachToAppRef(appRef: ApplicationRef): void;
14264
14248
  }
14265
14249
 
14266
14250
  /**
@@ -15209,7 +15193,7 @@ export declare function ɵɵdeferWhen(rawValue: unknown): void;
15209
15193
  * ```
15210
15194
  * @codeGenApi
15211
15195
  */
15212
- export declare function ɵɵdefineComponent<T>(componentDefinition: ComponentDefinition<T>): Mutable<ɵComponentDef<any>, keyof ɵComponentDef<any>>;
15196
+ export declare function ɵɵdefineComponent<T>(componentDefinition: ComponentDefinition<T>): ɵComponentDef<any>;
15213
15197
 
15214
15198
  /**
15215
15199
  * Create a directive definition object.
@@ -15227,7 +15211,7 @@ export declare function ɵɵdefineComponent<T>(componentDefinition: ComponentDef
15227
15211
  *
15228
15212
  * @codeGenApi
15229
15213
  */
15230
- export declare function ɵɵdefineDirective<T>(directiveDefinition: DirectiveDefinition<T>): Mutable<ɵDirectiveDef<any>, keyof ɵDirectiveDef<any>>;
15214
+ export declare function ɵɵdefineDirective<T>(directiveDefinition: DirectiveDefinition<T>): ɵDirectiveDef<any>;
15231
15215
 
15232
15216
  /**
15233
15217
  * Construct an injectable definition which defines how a token will be constructed by the DI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "18.2.7",
3
+ "version": "18.2.9",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.2.7
2
+ * @license Angular v18.2.9
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.2.7
2
+ * @license Angular v18.2.9
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.2.7
2
+ * @license Angular v18.2.9
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -5889,7 +5889,7 @@ var ShadowCss = class {
5889
5889
  });
5890
5890
  }
5891
5891
  _convertColonHostContext(cssText) {
5892
- return cssText.replace(_cssColonHostContextReGlobal, (selectorText) => {
5892
+ return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => {
5893
5893
  var _a2;
5894
5894
  const contextSelectorGroups = [[]];
5895
5895
  let match;
@@ -5904,7 +5904,7 @@ var ShadowCss = class {
5904
5904
  }
5905
5905
  selectorText = match[2];
5906
5906
  }
5907
- return contextSelectorGroups.map((contextSelectors) => combineHostContextSelectors(contextSelectors, selectorText)).join(", ");
5907
+ return contextSelectorGroups.map((contextSelectors) => _combineHostContextSelectors(contextSelectors, selectorText, pseudoPrefix)).join(", ");
5908
5908
  });
5909
5909
  }
5910
5910
  _convertShadowDOMSelectors(cssText) {
@@ -5915,7 +5915,12 @@ var ShadowCss = class {
5915
5915
  let selector = rule.selector;
5916
5916
  let content = rule.content;
5917
5917
  if (rule.selector[0] !== "@") {
5918
- selector = this._scopeSelector(rule.selector, scopeSelector, hostSelector);
5918
+ selector = this._scopeSelector({
5919
+ selector,
5920
+ scopeSelector,
5921
+ hostSelector,
5922
+ isParentSelector: true
5923
+ });
5919
5924
  } else if (scopedAtRuleIdentifiers.some((atRule) => rule.selector.startsWith(atRule))) {
5920
5925
  content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
5921
5926
  } else if (rule.selector.startsWith("@font-face") || rule.selector.startsWith("@page")) {
@@ -5930,12 +5935,18 @@ var ShadowCss = class {
5930
5935
  return new CssRule(selector, rule.content);
5931
5936
  });
5932
5937
  }
5933
- _scopeSelector(selector, scopeSelector, hostSelector) {
5934
- return selector.split(/ ?, ?/).map((part) => part.split(_shadowDeepSelectors)).map((deepParts) => {
5938
+ _scopeSelector({ selector, scopeSelector, hostSelector, isParentSelector = false }) {
5939
+ const selectorSplitRe = / ?,(?!(?:[^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\))) ?/;
5940
+ return selector.split(selectorSplitRe).map((part) => part.split(_shadowDeepSelectors)).map((deepParts) => {
5935
5941
  const [shallowPart, ...otherParts] = deepParts;
5936
5942
  const applyScope = (shallowPart2) => {
5937
5943
  if (this._selectorNeedsScoping(shallowPart2, scopeSelector)) {
5938
- return this._applySelectorScope(shallowPart2, scopeSelector, hostSelector);
5944
+ return this._applySelectorScope({
5945
+ selector: shallowPart2,
5946
+ scopeSelector,
5947
+ hostSelector,
5948
+ isParentSelector
5949
+ });
5939
5950
  } else {
5940
5951
  return shallowPart2;
5941
5952
  }
@@ -5957,15 +5968,15 @@ var ShadowCss = class {
5957
5968
  _polyfillHostRe.lastIndex = 0;
5958
5969
  if (_polyfillHostRe.test(selector)) {
5959
5970
  const replaceBy = `[${hostSelector}]`;
5960
- return selector.replace(_polyfillHostNoCombinatorRe, (hnc, selector2) => {
5961
- return selector2.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
5971
+ return selector.replace(_polyfillHostNoCombinatorReGlobal, (_hnc, selector2) => {
5972
+ return selector2.replace(/([^:\)]*)(:*)(.*)/, (_, before, colon, after) => {
5962
5973
  return before + replaceBy + colon + after;
5963
5974
  });
5964
5975
  }).replace(_polyfillHostRe, replaceBy + " ");
5965
5976
  }
5966
5977
  return scopeSelector + " " + selector;
5967
5978
  }
5968
- _applySelectorScope(selector, scopeSelector, hostSelector) {
5979
+ _applySelectorScope({ selector, scopeSelector, hostSelector, isParentSelector }) {
5969
5980
  var _a2;
5970
5981
  const isRe = /\[is=([^\]]*)\]/g;
5971
5982
  scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
@@ -5977,6 +5988,10 @@ var ShadowCss = class {
5977
5988
  }
5978
5989
  if (p.includes(_polyfillHostNoCombinator)) {
5979
5990
  scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector);
5991
+ if (_polyfillHostNoCombinatorWithinPseudoFunction.test(p)) {
5992
+ const [_, before, colon, after] = scopedP.match(/([^:]*)(:*)(.*)/);
5993
+ scopedP = before + attrName + colon + after;
5994
+ }
5980
5995
  } else {
5981
5996
  const t = p.replace(_polyfillHostRe, "");
5982
5997
  if (t.length > 0) {
@@ -5988,29 +6003,52 @@ var ShadowCss = class {
5988
6003
  }
5989
6004
  return scopedP;
5990
6005
  };
5991
- const safeContent = new SafeSelector(selector);
5992
- selector = safeContent.content();
6006
+ const _pseudoFunctionAwareScopeSelectorPart = (selectorPart) => {
6007
+ let scopedPart = "";
6008
+ const cssPrefixWithPseudoSelectorFunctionMatch = selectorPart.match(_cssPrefixWithPseudoSelectorFunction);
6009
+ if (cssPrefixWithPseudoSelectorFunctionMatch) {
6010
+ const [cssPseudoSelectorFunction] = cssPrefixWithPseudoSelectorFunctionMatch;
6011
+ const selectorToScope = selectorPart.slice(cssPseudoSelectorFunction.length, -1);
6012
+ if (selectorToScope.includes(_polyfillHostNoCombinator)) {
6013
+ this._shouldScopeIndicator = true;
6014
+ }
6015
+ const scopedInnerPart = this._scopeSelector({
6016
+ selector: selectorToScope,
6017
+ scopeSelector,
6018
+ hostSelector
6019
+ });
6020
+ scopedPart = `${cssPseudoSelectorFunction}${scopedInnerPart})`;
6021
+ } else {
6022
+ this._shouldScopeIndicator = this._shouldScopeIndicator || selectorPart.includes(_polyfillHostNoCombinator);
6023
+ scopedPart = this._shouldScopeIndicator ? _scopeSelectorPart(selectorPart) : selectorPart;
6024
+ }
6025
+ return scopedPart;
6026
+ };
6027
+ if (isParentSelector) {
6028
+ this._safeSelector = new SafeSelector(selector);
6029
+ selector = this._safeSelector.content();
6030
+ }
5993
6031
  let scopedSelector = "";
5994
6032
  let startIndex = 0;
5995
6033
  let res;
5996
- const sep = /( |>|\+|~(?!=))\s*/g;
6034
+ const sep = /( |>|\+|~(?!=))(?!([^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\)))\s*/g;
5997
6035
  const hasHost = selector.includes(_polyfillHostNoCombinator);
5998
- let shouldScope = !hasHost;
6036
+ if (isParentSelector || this._shouldScopeIndicator) {
6037
+ this._shouldScopeIndicator = !hasHost;
6038
+ }
5999
6039
  while ((res = sep.exec(selector)) !== null) {
6000
6040
  const separator = res[1];
6001
6041
  const part2 = selector.slice(startIndex, res.index);
6002
6042
  if (part2.match(/__esc-ph-(\d+)__/) && ((_a2 = selector[res.index + 1]) == null ? void 0 : _a2.match(/[a-fA-F\d]/))) {
6003
6043
  continue;
6004
6044
  }
6005
- shouldScope = shouldScope || part2.includes(_polyfillHostNoCombinator);
6006
- const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;
6045
+ const scopedPart = _pseudoFunctionAwareScopeSelectorPart(part2);
6007
6046
  scopedSelector += `${scopedPart} ${separator} `;
6008
6047
  startIndex = sep.lastIndex;
6009
6048
  }
6010
6049
  const part = selector.substring(startIndex);
6011
- shouldScope = shouldScope || part.includes(_polyfillHostNoCombinator);
6012
- scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
6013
- return safeContent.restore(scopedSelector);
6050
+ scopedSelector += _pseudoFunctionAwareScopeSelectorPart(part);
6051
+ return this._safeSelector.restore(scopedSelector);
6014
6052
  }
6015
6053
  _insertPolyfillHostInCssText(selector) {
6016
6054
  return selector.replace(_colonHostContextRe, _polyfillHostContext).replace(_colonHostRe, _polyfillHost);
@@ -6049,6 +6087,8 @@ var SafeSelector = class {
6049
6087
  });
6050
6088
  }
6051
6089
  };
6090
+ var _cssScopedPseudoFunctionPrefix = "(:(where|is)\\()?";
6091
+ var _cssPrefixWithPseudoSelectorFunction = /^:(where|is)\(/i;
6052
6092
  var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim;
6053
6093
  var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
6054
6094
  var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
@@ -6056,10 +6096,12 @@ var _polyfillHost = "-shadowcsshost";
6056
6096
  var _polyfillHostContext = "-shadowcsscontext";
6057
6097
  var _parenSuffix = "(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
6058
6098
  var _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix, "gim");
6059
- var _cssColonHostContextReGlobal = new RegExp(_polyfillHostContext + _parenSuffix, "gim");
6099
+ var _cssColonHostContextReGlobal = new RegExp(_cssScopedPseudoFunctionPrefix + "(" + _polyfillHostContext + _parenSuffix + ")", "gim");
6060
6100
  var _cssColonHostContextRe = new RegExp(_polyfillHostContext + _parenSuffix, "im");
6061
6101
  var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
6102
+ var _polyfillHostNoCombinatorWithinPseudoFunction = new RegExp(`:.*\\(.*${_polyfillHostNoCombinator}.*\\)`);
6062
6103
  var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
6104
+ var _polyfillHostNoCombinatorReGlobal = new RegExp(_polyfillHostNoCombinatorRe, "g");
6063
6105
  var _shadowDOMSelectorsRe = [
6064
6106
  /::shadow/g,
6065
6107
  /::content/g,
@@ -6194,7 +6236,7 @@ function unescapeInStrings(input) {
6194
6236
  function unescapeQuotes(str, isQuoted) {
6195
6237
  return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, "$1");
6196
6238
  }
6197
- function combineHostContextSelectors(contextSelectors, otherSelectors) {
6239
+ function _combineHostContextSelectors(contextSelectors, otherSelectors, pseudoPrefix = "") {
6198
6240
  const hostMarker = _polyfillHostNoCombinator;
6199
6241
  _polyfillHostRe.lastIndex = 0;
6200
6242
  const otherSelectorsHasHost = _polyfillHostRe.test(otherSelectors);
@@ -6212,7 +6254,7 @@ function combineHostContextSelectors(contextSelectors, otherSelectors) {
6212
6254
  combined[i] = contextSelector + previousSelectors;
6213
6255
  }
6214
6256
  }
6215
- return combined.map((s) => otherSelectorsHasHost ? `${s}${otherSelectors}` : `${s}${hostMarker}${otherSelectors}, ${s} ${hostMarker}${otherSelectors}`).join(",");
6257
+ return combined.map((s) => otherSelectorsHasHost ? `${pseudoPrefix}${s}${otherSelectors}` : `${pseudoPrefix}${s}${hostMarker}${otherSelectors}, ${pseudoPrefix}${s} ${hostMarker}${otherSelectors}`).join(",");
6216
6258
  }
6217
6259
  function repeatGroups(groups, multiples) {
6218
6260
  const length = groups.length;
@@ -23451,7 +23493,7 @@ function publishFacade(global) {
23451
23493
  }
23452
23494
 
23453
23495
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
23454
- var VERSION2 = new Version("18.2.7");
23496
+ var VERSION2 = new Version("18.2.9");
23455
23497
 
23456
23498
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
23457
23499
  var _VisitorMode;
@@ -5889,7 +5889,7 @@ var ShadowCss = class {
5889
5889
  });
5890
5890
  }
5891
5891
  _convertColonHostContext(cssText) {
5892
- return cssText.replace(_cssColonHostContextReGlobal, (selectorText) => {
5892
+ return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => {
5893
5893
  var _a2;
5894
5894
  const contextSelectorGroups = [[]];
5895
5895
  let match;
@@ -5904,7 +5904,7 @@ var ShadowCss = class {
5904
5904
  }
5905
5905
  selectorText = match[2];
5906
5906
  }
5907
- return contextSelectorGroups.map((contextSelectors) => combineHostContextSelectors(contextSelectors, selectorText)).join(", ");
5907
+ return contextSelectorGroups.map((contextSelectors) => _combineHostContextSelectors(contextSelectors, selectorText, pseudoPrefix)).join(", ");
5908
5908
  });
5909
5909
  }
5910
5910
  _convertShadowDOMSelectors(cssText) {
@@ -5915,7 +5915,12 @@ var ShadowCss = class {
5915
5915
  let selector = rule.selector;
5916
5916
  let content = rule.content;
5917
5917
  if (rule.selector[0] !== "@") {
5918
- selector = this._scopeSelector(rule.selector, scopeSelector, hostSelector);
5918
+ selector = this._scopeSelector({
5919
+ selector,
5920
+ scopeSelector,
5921
+ hostSelector,
5922
+ isParentSelector: true
5923
+ });
5919
5924
  } else if (scopedAtRuleIdentifiers.some((atRule) => rule.selector.startsWith(atRule))) {
5920
5925
  content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
5921
5926
  } else if (rule.selector.startsWith("@font-face") || rule.selector.startsWith("@page")) {
@@ -5930,12 +5935,18 @@ var ShadowCss = class {
5930
5935
  return new CssRule(selector, rule.content);
5931
5936
  });
5932
5937
  }
5933
- _scopeSelector(selector, scopeSelector, hostSelector) {
5934
- return selector.split(/ ?, ?/).map((part) => part.split(_shadowDeepSelectors)).map((deepParts) => {
5938
+ _scopeSelector({ selector, scopeSelector, hostSelector, isParentSelector = false }) {
5939
+ const selectorSplitRe = / ?,(?!(?:[^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\))) ?/;
5940
+ return selector.split(selectorSplitRe).map((part) => part.split(_shadowDeepSelectors)).map((deepParts) => {
5935
5941
  const [shallowPart, ...otherParts] = deepParts;
5936
5942
  const applyScope = (shallowPart2) => {
5937
5943
  if (this._selectorNeedsScoping(shallowPart2, scopeSelector)) {
5938
- return this._applySelectorScope(shallowPart2, scopeSelector, hostSelector);
5944
+ return this._applySelectorScope({
5945
+ selector: shallowPart2,
5946
+ scopeSelector,
5947
+ hostSelector,
5948
+ isParentSelector
5949
+ });
5939
5950
  } else {
5940
5951
  return shallowPart2;
5941
5952
  }
@@ -5957,15 +5968,15 @@ var ShadowCss = class {
5957
5968
  _polyfillHostRe.lastIndex = 0;
5958
5969
  if (_polyfillHostRe.test(selector)) {
5959
5970
  const replaceBy = `[${hostSelector}]`;
5960
- return selector.replace(_polyfillHostNoCombinatorRe, (hnc, selector2) => {
5961
- return selector2.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
5971
+ return selector.replace(_polyfillHostNoCombinatorReGlobal, (_hnc, selector2) => {
5972
+ return selector2.replace(/([^:\)]*)(:*)(.*)/, (_, before, colon, after) => {
5962
5973
  return before + replaceBy + colon + after;
5963
5974
  });
5964
5975
  }).replace(_polyfillHostRe, replaceBy + " ");
5965
5976
  }
5966
5977
  return scopeSelector + " " + selector;
5967
5978
  }
5968
- _applySelectorScope(selector, scopeSelector, hostSelector) {
5979
+ _applySelectorScope({ selector, scopeSelector, hostSelector, isParentSelector }) {
5969
5980
  var _a2;
5970
5981
  const isRe = /\[is=([^\]]*)\]/g;
5971
5982
  scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
@@ -5977,6 +5988,10 @@ var ShadowCss = class {
5977
5988
  }
5978
5989
  if (p.includes(_polyfillHostNoCombinator)) {
5979
5990
  scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector);
5991
+ if (_polyfillHostNoCombinatorWithinPseudoFunction.test(p)) {
5992
+ const [_, before, colon, after] = scopedP.match(/([^:]*)(:*)(.*)/);
5993
+ scopedP = before + attrName + colon + after;
5994
+ }
5980
5995
  } else {
5981
5996
  const t = p.replace(_polyfillHostRe, "");
5982
5997
  if (t.length > 0) {
@@ -5988,29 +6003,52 @@ var ShadowCss = class {
5988
6003
  }
5989
6004
  return scopedP;
5990
6005
  };
5991
- const safeContent = new SafeSelector(selector);
5992
- selector = safeContent.content();
6006
+ const _pseudoFunctionAwareScopeSelectorPart = (selectorPart) => {
6007
+ let scopedPart = "";
6008
+ const cssPrefixWithPseudoSelectorFunctionMatch = selectorPart.match(_cssPrefixWithPseudoSelectorFunction);
6009
+ if (cssPrefixWithPseudoSelectorFunctionMatch) {
6010
+ const [cssPseudoSelectorFunction] = cssPrefixWithPseudoSelectorFunctionMatch;
6011
+ const selectorToScope = selectorPart.slice(cssPseudoSelectorFunction.length, -1);
6012
+ if (selectorToScope.includes(_polyfillHostNoCombinator)) {
6013
+ this._shouldScopeIndicator = true;
6014
+ }
6015
+ const scopedInnerPart = this._scopeSelector({
6016
+ selector: selectorToScope,
6017
+ scopeSelector,
6018
+ hostSelector
6019
+ });
6020
+ scopedPart = `${cssPseudoSelectorFunction}${scopedInnerPart})`;
6021
+ } else {
6022
+ this._shouldScopeIndicator = this._shouldScopeIndicator || selectorPart.includes(_polyfillHostNoCombinator);
6023
+ scopedPart = this._shouldScopeIndicator ? _scopeSelectorPart(selectorPart) : selectorPart;
6024
+ }
6025
+ return scopedPart;
6026
+ };
6027
+ if (isParentSelector) {
6028
+ this._safeSelector = new SafeSelector(selector);
6029
+ selector = this._safeSelector.content();
6030
+ }
5993
6031
  let scopedSelector = "";
5994
6032
  let startIndex = 0;
5995
6033
  let res;
5996
- const sep = /( |>|\+|~(?!=))\s*/g;
6034
+ const sep = /( |>|\+|~(?!=))(?!([^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\)))\s*/g;
5997
6035
  const hasHost = selector.includes(_polyfillHostNoCombinator);
5998
- let shouldScope = !hasHost;
6036
+ if (isParentSelector || this._shouldScopeIndicator) {
6037
+ this._shouldScopeIndicator = !hasHost;
6038
+ }
5999
6039
  while ((res = sep.exec(selector)) !== null) {
6000
6040
  const separator = res[1];
6001
6041
  const part2 = selector.slice(startIndex, res.index);
6002
6042
  if (part2.match(/__esc-ph-(\d+)__/) && ((_a2 = selector[res.index + 1]) == null ? void 0 : _a2.match(/[a-fA-F\d]/))) {
6003
6043
  continue;
6004
6044
  }
6005
- shouldScope = shouldScope || part2.includes(_polyfillHostNoCombinator);
6006
- const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;
6045
+ const scopedPart = _pseudoFunctionAwareScopeSelectorPart(part2);
6007
6046
  scopedSelector += `${scopedPart} ${separator} `;
6008
6047
  startIndex = sep.lastIndex;
6009
6048
  }
6010
6049
  const part = selector.substring(startIndex);
6011
- shouldScope = shouldScope || part.includes(_polyfillHostNoCombinator);
6012
- scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
6013
- return safeContent.restore(scopedSelector);
6050
+ scopedSelector += _pseudoFunctionAwareScopeSelectorPart(part);
6051
+ return this._safeSelector.restore(scopedSelector);
6014
6052
  }
6015
6053
  _insertPolyfillHostInCssText(selector) {
6016
6054
  return selector.replace(_colonHostContextRe, _polyfillHostContext).replace(_colonHostRe, _polyfillHost);
@@ -6049,6 +6087,8 @@ var SafeSelector = class {
6049
6087
  });
6050
6088
  }
6051
6089
  };
6090
+ var _cssScopedPseudoFunctionPrefix = "(:(where|is)\\()?";
6091
+ var _cssPrefixWithPseudoSelectorFunction = /^:(where|is)\(/i;
6052
6092
  var _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim;
6053
6093
  var _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
6054
6094
  var _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
@@ -6056,10 +6096,12 @@ var _polyfillHost = "-shadowcsshost";
6056
6096
  var _polyfillHostContext = "-shadowcsscontext";
6057
6097
  var _parenSuffix = "(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
6058
6098
  var _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix, "gim");
6059
- var _cssColonHostContextReGlobal = new RegExp(_polyfillHostContext + _parenSuffix, "gim");
6099
+ var _cssColonHostContextReGlobal = new RegExp(_cssScopedPseudoFunctionPrefix + "(" + _polyfillHostContext + _parenSuffix + ")", "gim");
6060
6100
  var _cssColonHostContextRe = new RegExp(_polyfillHostContext + _parenSuffix, "im");
6061
6101
  var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
6102
+ var _polyfillHostNoCombinatorWithinPseudoFunction = new RegExp(`:.*\\(.*${_polyfillHostNoCombinator}.*\\)`);
6062
6103
  var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
6104
+ var _polyfillHostNoCombinatorReGlobal = new RegExp(_polyfillHostNoCombinatorRe, "g");
6063
6105
  var _shadowDOMSelectorsRe = [
6064
6106
  /::shadow/g,
6065
6107
  /::content/g,
@@ -6194,7 +6236,7 @@ function unescapeInStrings(input) {
6194
6236
  function unescapeQuotes(str, isQuoted) {
6195
6237
  return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, "$1");
6196
6238
  }
6197
- function combineHostContextSelectors(contextSelectors, otherSelectors) {
6239
+ function _combineHostContextSelectors(contextSelectors, otherSelectors, pseudoPrefix = "") {
6198
6240
  const hostMarker = _polyfillHostNoCombinator;
6199
6241
  _polyfillHostRe.lastIndex = 0;
6200
6242
  const otherSelectorsHasHost = _polyfillHostRe.test(otherSelectors);
@@ -6212,7 +6254,7 @@ function combineHostContextSelectors(contextSelectors, otherSelectors) {
6212
6254
  combined[i] = contextSelector + previousSelectors;
6213
6255
  }
6214
6256
  }
6215
- return combined.map((s) => otherSelectorsHasHost ? `${s}${otherSelectors}` : `${s}${hostMarker}${otherSelectors}, ${s} ${hostMarker}${otherSelectors}`).join(",");
6257
+ return combined.map((s) => otherSelectorsHasHost ? `${pseudoPrefix}${s}${otherSelectors}` : `${pseudoPrefix}${s}${hostMarker}${otherSelectors}, ${pseudoPrefix}${s} ${hostMarker}${otherSelectors}`).join(",");
6216
6258
  }
6217
6259
  function repeatGroups(groups, multiples) {
6218
6260
  const length = groups.length;
@@ -23451,7 +23493,7 @@ function publishFacade(global) {
23451
23493
  }
23452
23494
 
23453
23495
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
23454
- var VERSION2 = new Version("18.2.7");
23496
+ var VERSION2 = new Version("18.2.9");
23455
23497
 
23456
23498
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
23457
23499
  var _VisitorMode;