@aceshooting/lyra-ui 25.6.1 → 25.6.2

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.
@@ -126,8 +126,9 @@ export type ButtonFormMethod='get'|'post'|'dialog';export interface LyraButtonEv
126
126
  * `--lr-color-mix-active` share, so the pressed state reads as more than the hover.
127
127
  * `appearance="link"` moves its text colour by these two shares instead of taking a background.
128
128
  * @cssprop --lr-button-hover-color - Text color of a non-disabled button while hovered or pressed.
129
- * **Undeclared by default**, so it falls back to whatever colour the active `appearance` already
130
- * paints at rest — every appearance's current hover text colour is unchanged until this is set.
129
+ * **Undeclared by default**. Quiet and chromatic plain text move toward body text during hover
130
+ * and press to retain contrast against the moving fill; other appearances keep their resting
131
+ * foreground. An explicit override takes precedence in both pointer states.
131
132
  * `appearance="link"` ignores it: its own hover rule sets a higher-specificity colour mix instead.
132
133
  * @cssprop --lr-button-hover-border - Border color of a non-disabled button while hovered.
133
134
  * **Undeclared by default**, so it falls back to whatever border colour the active `appearance`
@@ -1 +1 @@
1
- import{css}from"lit";const styles=css`:host{--_lr-button-width:100%;--_lr-button-size-2xs:var(--lr-form-control-height-2xs);--_lr-button-size-xs:var(--lr-form-control-height-xs);--_lr-button-size-s:var(--lr-form-control-height-s);--_lr-button-size-m:var(--lr-form-control-height-m);--_lr-button-size-l:var(--lr-form-control-height-l);--_lr-button-size-xl:var(--lr-form-control-height-xl);--_lr-button-padding-block:var(--lr-form-control-padding-block);--_lr-button-padding-inline:var(--lr-form-control-padding-inline);--_lr-button-font-size:var(--lr-form-control-font-size);--_lr-button-min-height:var(--lr-button-size-m,var(--_lr-button-size-m));--_lr-button-gap:var(--lr-form-control-gap);--_lr-button-radius:var(--lr-radius-button);--_lr-button-caret-size:var(--lr-size-0-75em);--_lr-button-glass-accent:color-mix(in srgb, var(--lr-color-fill-loud), var(--lr-color-text) var(--_lr-glass-foreground-weight));--_lr-button-accent:var(--_lr-button-glass-accent,var(--lr-color-fill-loud));--_lr-button-fill:var(--lr-color-fill-quiet);--_lr-button-on-fill:var(--lr-color-on-quiet);--_lr-button-border:var(--lr-color-border-normal);--_lr-button-outlined-border:var(--lr-color-border-strong);--_lr-button-outlined-fill:transparent;--_lr-button-quiet-border:var(--lr-color-border);--_lr-button-quiet-text:var(--lr-color-text-quiet);--_lr-button-accent-fill:var(--lr-color-fill-loud);--_lr-button-accent-on-fill:var(--lr-color-on-loud);--_lr-button-resolved-color:var(--lr-button-on-fill,var(--_lr-button-on-fill));--_lr-button-resolved-border:var(--lr-button-border,var(--_lr-button-border));--_lr-button-hover-base:var(--lr-color-surface);--_lr-button-hover-background:color-mix(in oklab, var(--lr-button-hover-base,var(--_lr-button-hover-base)), var(--lr-color-mix-partner) var(--lr-color-mix-hover));--_lr-button-active-background:color-mix(in oklab, var(--lr-button-hover-base,var(--_lr-button-hover-base)), var(--lr-color-mix-partner) var(--lr-color-mix-active));min-inline-size:0;max-inline-size:100%;display:inline-block}:host([appearance=filled]),:host([appearance=filled-outlined]){--_lr-button-hover-base:var(--lr-button-fill,var(--_lr-button-fill))}:host([appearance=accent]){--_lr-button-hover-base:var(--lr-button-accent-fill,var(--_lr-button-accent-fill));--_lr-button-resolved-color:var(--lr-button-accent-on-fill,var(--_lr-button-accent-on-fill));--_lr-button-resolved-border:var(--lr-button-accent-fill,var(--_lr-button-accent-fill))}:host([outline]){--_lr-button-hover-base:var(--lr-color-surface)}:host([appearance=outlined]),:host([outline]){--_lr-button-resolved-color:var(--lr-button-accent,var(--_lr-button-accent));--_lr-button-resolved-border:var(--lr-button-outlined-border,var(--_lr-button-outlined-border))}:host([appearance=filled-outlined]){--_lr-button-resolved-border:var(--lr-button-outlined-border,var(--_lr-button-outlined-border))}:host([appearance=plain]){--_lr-button-resolved-color:var(--lr-button-accent,var(--_lr-button-accent));--_lr-button-resolved-border:transparent}:host([appearance=plain][variant]:not([variant=neutral])){--_lr-button-hover-color:color-mix(in oklab, var(--_lr-button-resolved-color), var(--lr-color-text) min(100%, calc(2 * var(--lr-color-mix-hover))));--_lr-button-active-color:color-mix(in oklab, var(--_lr-button-resolved-color), var(--lr-color-text) min(100%, calc(2 * var(--lr-color-mix-active))))}:host([appearance=quiet]){--_lr-button-resolved-color:var(--lr-button-quiet-color,var(--_lr-button-quiet-text));--_lr-button-resolved-border:var(--lr-button-quiet-border,var(--_lr-button-quiet-border))}:host(:not([variant])),:host([variant=neutral]){--_lr-button-accent:var(--lr-color-text)}:host([pill]),:host([circle]){--_lr-button-radius:var(--lr-radius-pill)}[part~=base]{box-sizing:border-box;inline-size:var(--lr-button-width,var(--_lr-button-width));min-inline-size:0;max-inline-size:100%;min-block-size:var(--lr-button-height,var(--lr-button-min-height,var(--_lr-button-min-height)));block-size:var(--lr-button-height,auto);align-items:center;justify-content:var(--lr-button-justify,center);gap:var(--lr-button-gap,var(--_lr-button-gap));padding-inline:var(--lr-button-padding-inline,var(--_lr-button-padding-inline));padding-block:var(--lr-button-padding-block,var(--_lr-button-padding-block));border-radius:var(--lr-button-radius,var(--_lr-button-radius));border:var(--lr-border-width-thin) solid var(--lr-button-border,var(--_lr-button-border));font:inherit;font-weight:var(--lr-font-weight-semibold);font-size:var(--lr-button-font-size,var(--_lr-button-font-size));cursor:pointer;box-shadow:var(--lr-button-shadow,none);text-decoration:none;display:inline-flex;position:relative}:host([appearance=filled]) [part~=base]{background:var(--lr-button-fill,var(--_lr-button-fill));color:var(--lr-button-on-fill,var(--_lr-button-on-fill))}:host([appearance=accent]) [part~=base]{background:var(--lr-button-accent-fill,var(--_lr-button-accent-fill));color:var(--lr-button-accent-on-fill,var(--_lr-button-accent-on-fill));border-color:var(--lr-button-accent-fill,var(--_lr-button-accent-fill))}:host([appearance=outlined]) [part~=base],:host([outline]) [part~=base]{background:var(--lr-button-outlined-fill,var(--_lr-button-outlined-fill));color:var(--lr-button-accent,var(--_lr-button-accent));border-color:var(--lr-button-outlined-border,var(--_lr-button-outlined-border))}:host([appearance=filled-outlined]) [part~=base]{background:var(--lr-button-fill,var(--_lr-button-fill));color:var(--lr-button-on-fill,var(--_lr-button-on-fill));border-color:var(--lr-button-outlined-border,var(--_lr-button-outlined-border))}:host([appearance=plain]) [part~=base]{color:var(--lr-button-accent,var(--_lr-button-accent));background:0 0;border-color:#0000}:host([appearance=quiet]) [part~=base]{color:var(--lr-button-quiet-color,var(--_lr-button-quiet-text));border-color:var(--lr-button-quiet-border,var(--_lr-button-quiet-border));background:0 0}[part~=base]:disabled,[part~=base][aria-disabled=true]{opacity:var(--lr-opacity-disabled);cursor:not-allowed}[part~=base]:not(:disabled,[aria-disabled=true]){transition:background-color var(--lr-transition-fast), color var(--lr-transition-fast), transform var(--lr-transition-fast)}[part~=base]:not(:disabled,[aria-disabled=true]):hover{background:var(--lr-button-hover-bg,var(--_lr-button-hover-background));color:var(--lr-button-hover-color,var(--_lr-button-hover-color,var(--_lr-button-resolved-color)));border-color:var(--lr-button-hover-border,var(--_lr-button-resolved-border))}[part~=base]:not(:disabled,[aria-disabled=true]):active{background:var(--lr-button-active-bg,var(--_lr-button-active-background));color:var(--lr-button-hover-color,var(--_lr-button-active-color,var(--_lr-button-resolved-color)));transform:scale(var(--lr-button-active-scale,.9875))}@media (prefers-reduced-motion:reduce){[part~=base]:not(:disabled,[aria-disabled=true]):active{transform:none}}[part~=base]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part~=start],[part~=end]{text-overflow:ellipsis;white-space:nowrap;flex:none;align-items:center;min-inline-size:0;max-inline-size:40%;display:inline-flex;overflow:hidden}[part~=start] ::slotted(*),[part~=end] ::slotted(*){text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;max-inline-size:100%;overflow:hidden}[part=label]{flex:var(--lr-button-label-grow,0) 1 auto;text-align:start;text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;overflow:hidden}[part~=base][data-grow-label] [part=label]{flex-grow:var(--lr-button-label-grow,1)}:host([wrap]) [part=label]{text-overflow:clip;white-space:normal;overflow-wrap:anywhere;overflow:visible}[part~=start][hidden],[part~=end][hidden]{display:none}:host([circle]) [part~=base],[part~=base][data-icon-button]{inline-size:var(--lr-button-height,var(--lr-button-min-height,var(--_lr-button-min-height)));min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);aspect-ratio:1;padding-inline:var(--lr-button-padding-block,var(--_lr-button-padding-block))}[part~=base][data-icon-button] [part=label]{overflow:visible}[part=caret]{font-size:var(--lr-button-caret-size,var(--_lr-button-caret-size));flex:none;align-items:center;display:inline-flex}[part=caret] svg{transform:rotate(90deg)}:host([size="2xs"]){--_lr-button-min-height:var(--lr-button-size-2xs,var(--_lr-button-size-2xs))}:host([size=xs]){--_lr-button-min-height:var(--lr-button-size-xs,var(--_lr-button-size-xs))}:host([size=s]),:host([size=small]){--_lr-button-min-height:var(--lr-button-size-s,var(--_lr-button-size-s))}:host([size=l]),:host([size=large]){--_lr-button-min-height:var(--lr-button-size-l,var(--_lr-button-size-l))}:host([size=xl]){--_lr-button-min-height:var(--lr-button-size-xl,var(--_lr-button-size-xl))}:host([appearance=link]) [part~=base]{block-size:auto;min-block-size:0;inline-size:auto;color:var(--lr-button-accent,var(--_lr-button-accent));font:inherit;text-underline-offset:var(--lr-size-0-15rem);box-shadow:none;background:0 0;border:0;border-radius:0;padding:0;text-decoration:underline}:host([appearance=link]) [part~=base]:not(:disabled,[aria-disabled=true]):hover{color:color-mix(in oklab, var(--lr-button-accent,var(--_lr-button-accent)), var(--lr-color-mix-partner) var(--lr-color-mix-hover));background:0 0}:host([appearance=link]) [part~=base]:not(:disabled,[aria-disabled=true]):active{color:color-mix(in oklab, var(--lr-button-accent,var(--_lr-button-accent)), var(--lr-color-mix-partner) var(--lr-color-mix-active));background:0 0}[part=spinner]{inline-size:var(--lr-size-1em);block-size:var(--lr-size-1em);animation:var(--_lr-motion-animation,lr-button-spin var(--lr-button-spinner-duration,var(--lr-transition-ambient)) infinite);justify-content:center;align-items:center;margin:auto;display:inline-flex;position:absolute;inset:0}:host([loading]) [part~=start],:host([loading]) [part=label],:host([loading]) [part~=end],:host([loading]) [part=caret]{opacity:0}@keyframes lr-button-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){[part=spinner]{animation-duration:var(--_lr-motion-duration,.001ms);animation-iteration-count:1}}`;export{styles};
1
+ import{css}from"lit";const styles=css`:host{--_lr-button-width:100%;--_lr-button-size-2xs:var(--lr-form-control-height-2xs);--_lr-button-size-xs:var(--lr-form-control-height-xs);--_lr-button-size-s:var(--lr-form-control-height-s);--_lr-button-size-m:var(--lr-form-control-height-m);--_lr-button-size-l:var(--lr-form-control-height-l);--_lr-button-size-xl:var(--lr-form-control-height-xl);--_lr-button-padding-block:var(--lr-form-control-padding-block);--_lr-button-padding-inline:var(--lr-form-control-padding-inline);--_lr-button-font-size:var(--lr-form-control-font-size);--_lr-button-min-height:var(--lr-button-size-m,var(--_lr-button-size-m));--_lr-button-gap:var(--lr-form-control-gap);--_lr-button-radius:var(--lr-radius-button);--_lr-button-caret-size:var(--lr-size-0-75em);--_lr-button-glass-accent:color-mix(in srgb, var(--lr-color-fill-loud), var(--lr-color-text) var(--_lr-glass-foreground-weight));--_lr-button-accent:var(--_lr-button-glass-accent,var(--lr-color-fill-loud));--_lr-button-fill:var(--lr-color-fill-quiet);--_lr-button-on-fill:var(--lr-color-on-quiet);--_lr-button-border:var(--lr-color-border-normal);--_lr-button-outlined-border:var(--lr-color-border-strong);--_lr-button-outlined-fill:transparent;--_lr-button-quiet-border:var(--lr-color-border);--_lr-button-quiet-text:var(--lr-color-text-quiet);--_lr-button-accent-fill:var(--lr-color-fill-loud);--_lr-button-accent-on-fill:var(--lr-color-on-loud);--_lr-button-resolved-color:var(--lr-button-on-fill,var(--_lr-button-on-fill));--_lr-button-resolved-border:var(--lr-button-border,var(--_lr-button-border));--_lr-button-hover-base:var(--lr-color-surface);--_lr-button-hover-background:color-mix(in oklab, var(--lr-button-hover-base,var(--_lr-button-hover-base)), var(--lr-color-mix-partner) var(--lr-color-mix-hover));--_lr-button-active-background:color-mix(in oklab, var(--lr-button-hover-base,var(--_lr-button-hover-base)), var(--lr-color-mix-partner) var(--lr-color-mix-active));min-inline-size:0;max-inline-size:100%;display:inline-block}:host([appearance=filled]),:host([appearance=filled-outlined]){--_lr-button-hover-base:var(--lr-button-fill,var(--_lr-button-fill))}:host([appearance=accent]){--_lr-button-hover-base:var(--lr-button-accent-fill,var(--_lr-button-accent-fill));--_lr-button-resolved-color:var(--lr-button-accent-on-fill,var(--_lr-button-accent-on-fill));--_lr-button-resolved-border:var(--lr-button-accent-fill,var(--_lr-button-accent-fill))}:host([outline]){--_lr-button-hover-base:var(--lr-color-surface)}:host([appearance=outlined]),:host([outline]){--_lr-button-resolved-color:var(--lr-button-accent,var(--_lr-button-accent));--_lr-button-resolved-border:var(--lr-button-outlined-border,var(--_lr-button-outlined-border))}:host([appearance=filled-outlined]){--_lr-button-resolved-border:var(--lr-button-outlined-border,var(--_lr-button-outlined-border))}:host([appearance=plain]){--_lr-button-resolved-color:var(--lr-button-accent,var(--_lr-button-accent));--_lr-button-resolved-border:transparent}:host([appearance=quiet]),:host([appearance=plain][variant]:not([variant=neutral])){--_lr-button-hover-color:color-mix(in oklab, var(--_lr-button-resolved-color), var(--lr-color-text) min(100%, calc(2 * var(--lr-color-mix-hover))));--_lr-button-active-color:color-mix(in oklab, var(--_lr-button-resolved-color), var(--lr-color-text) min(100%, calc(2 * var(--lr-color-mix-active))))}:host([appearance=quiet]){--_lr-button-resolved-color:var(--lr-button-quiet-color,var(--_lr-button-quiet-text));--_lr-button-resolved-border:var(--lr-button-quiet-border,var(--_lr-button-quiet-border))}:host(:not([variant])),:host([variant=neutral]){--_lr-button-accent:var(--lr-color-text)}:host([pill]),:host([circle]){--_lr-button-radius:var(--lr-radius-pill)}[part~=base]{box-sizing:border-box;inline-size:var(--lr-button-width,var(--_lr-button-width));min-inline-size:0;max-inline-size:100%;min-block-size:var(--lr-button-height,var(--lr-button-min-height,var(--_lr-button-min-height)));block-size:var(--lr-button-height,auto);align-items:center;justify-content:var(--lr-button-justify,center);gap:var(--lr-button-gap,var(--_lr-button-gap));padding-inline:var(--lr-button-padding-inline,var(--_lr-button-padding-inline));padding-block:var(--lr-button-padding-block,var(--_lr-button-padding-block));border-radius:var(--lr-button-radius,var(--_lr-button-radius));border:var(--lr-border-width-thin) solid var(--lr-button-border,var(--_lr-button-border));font:inherit;font-weight:var(--lr-font-weight-semibold);font-size:var(--lr-button-font-size,var(--_lr-button-font-size));cursor:pointer;box-shadow:var(--lr-button-shadow,none);text-decoration:none;display:inline-flex;position:relative}:host([appearance=filled]) [part~=base]{background:var(--lr-button-fill,var(--_lr-button-fill));color:var(--lr-button-on-fill,var(--_lr-button-on-fill))}:host([appearance=accent]) [part~=base]{background:var(--lr-button-accent-fill,var(--_lr-button-accent-fill));color:var(--lr-button-accent-on-fill,var(--_lr-button-accent-on-fill));border-color:var(--lr-button-accent-fill,var(--_lr-button-accent-fill))}:host([appearance=outlined]) [part~=base],:host([outline]) [part~=base]{background:var(--lr-button-outlined-fill,var(--_lr-button-outlined-fill));color:var(--lr-button-accent,var(--_lr-button-accent));border-color:var(--lr-button-outlined-border,var(--_lr-button-outlined-border))}:host([appearance=filled-outlined]) [part~=base]{background:var(--lr-button-fill,var(--_lr-button-fill));color:var(--lr-button-on-fill,var(--_lr-button-on-fill));border-color:var(--lr-button-outlined-border,var(--_lr-button-outlined-border))}:host([appearance=plain]) [part~=base]{color:var(--lr-button-accent,var(--_lr-button-accent));background:0 0;border-color:#0000}:host([appearance=quiet]) [part~=base]{color:var(--lr-button-quiet-color,var(--_lr-button-quiet-text));border-color:var(--lr-button-quiet-border,var(--_lr-button-quiet-border));background:0 0}[part~=base]:disabled,[part~=base][aria-disabled=true]{opacity:var(--lr-opacity-disabled);cursor:not-allowed}[part~=base]:not(:disabled,[aria-disabled=true]){transition:background-color var(--lr-transition-fast), color var(--lr-transition-fast), transform var(--lr-transition-fast)}[part~=base]:not(:disabled,[aria-disabled=true]):hover{background:var(--lr-button-hover-bg,var(--_lr-button-hover-background));color:var(--lr-button-hover-color,var(--_lr-button-hover-color,var(--_lr-button-resolved-color)));border-color:var(--lr-button-hover-border,var(--_lr-button-resolved-border))}[part~=base]:not(:disabled,[aria-disabled=true]):active{background:var(--lr-button-active-bg,var(--_lr-button-active-background));color:var(--lr-button-hover-color,var(--_lr-button-active-color,var(--_lr-button-resolved-color)));transform:scale(var(--lr-button-active-scale,.9875))}@media (prefers-reduced-motion:reduce){[part~=base]:not(:disabled,[aria-disabled=true]):active{transform:none}}[part~=base]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part~=start],[part~=end]{text-overflow:ellipsis;white-space:nowrap;flex:none;align-items:center;min-inline-size:0;max-inline-size:40%;display:inline-flex;overflow:hidden}[part~=start] ::slotted(*),[part~=end] ::slotted(*){text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;max-inline-size:100%;overflow:hidden}[part=label]{flex:var(--lr-button-label-grow,0) 1 auto;text-align:start;text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;overflow:hidden}[part~=base][data-grow-label] [part=label]{flex-grow:var(--lr-button-label-grow,1)}:host([wrap]) [part=label]{text-overflow:clip;white-space:normal;overflow-wrap:anywhere;overflow:visible}[part~=start][hidden],[part~=end][hidden]{display:none}:host([circle]) [part~=base],[part~=base][data-icon-button]{inline-size:var(--lr-button-height,var(--lr-button-min-height,var(--_lr-button-min-height)));min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);aspect-ratio:1;padding-inline:var(--lr-button-padding-block,var(--_lr-button-padding-block))}[part~=base][data-icon-button] [part=label]{overflow:visible}[part=caret]{font-size:var(--lr-button-caret-size,var(--_lr-button-caret-size));flex:none;align-items:center;display:inline-flex}[part=caret] svg{transform:rotate(90deg)}:host([size="2xs"]){--_lr-button-min-height:var(--lr-button-size-2xs,var(--_lr-button-size-2xs))}:host([size=xs]){--_lr-button-min-height:var(--lr-button-size-xs,var(--_lr-button-size-xs))}:host([size=s]),:host([size=small]){--_lr-button-min-height:var(--lr-button-size-s,var(--_lr-button-size-s))}:host([size=l]),:host([size=large]){--_lr-button-min-height:var(--lr-button-size-l,var(--_lr-button-size-l))}:host([size=xl]){--_lr-button-min-height:var(--lr-button-size-xl,var(--_lr-button-size-xl))}:host([appearance=link]) [part~=base]{block-size:auto;min-block-size:0;inline-size:auto;color:var(--lr-button-accent,var(--_lr-button-accent));font:inherit;text-underline-offset:var(--lr-size-0-15rem);box-shadow:none;background:0 0;border:0;border-radius:0;padding:0;text-decoration:underline}:host([appearance=link]) [part~=base]:not(:disabled,[aria-disabled=true]):hover{color:color-mix(in oklab, var(--lr-button-accent,var(--_lr-button-accent)), var(--lr-color-mix-partner) var(--lr-color-mix-hover));background:0 0}:host([appearance=link]) [part~=base]:not(:disabled,[aria-disabled=true]):active{color:color-mix(in oklab, var(--lr-button-accent,var(--_lr-button-accent)), var(--lr-color-mix-partner) var(--lr-color-mix-active));background:0 0}[part=spinner]{inline-size:var(--lr-size-1em);block-size:var(--lr-size-1em);animation:var(--_lr-motion-animation,lr-button-spin var(--lr-button-spinner-duration,var(--lr-transition-ambient)) infinite);justify-content:center;align-items:center;margin:auto;display:inline-flex;position:absolute;inset:0}:host([loading]) [part~=start],:host([loading]) [part=label],:host([loading]) [part~=end],:host([loading]) [part=caret]{opacity:0}@keyframes lr-button-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){[part=spinner]{animation-duration:var(--_lr-motion-duration,.001ms);animation-iteration-count:1}}`;export{styles};
@@ -1,4 +1,4 @@
1
- import{__decorate}from"tslib";import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{isAccessibilitySubtreeExcluded,isAccessibilityVisibilityHidden,nextId,resolveAccessibleTrigger}from"../../../internal/a11y.js";import{acquireAriaOwnership}from"../../../internal/aria-ownership.js";import{isActionableElement}from"../../../internal/focus-navigation.js";import{deferredPlaceReady as place,syncTopLayerRelease,topLayerPlacement,waitForDeferredPlacement}from"../../../internal/anchored-overlay-runtime.js";import{virtualAnchorFromRect}from"../../../internal/positioner-geometry.js";import{rtlAwarePlacement}from"../../../internal/rtl.js";import{composedParentElement,deepActiveElementIn}from"../../../internal/active-element.js";import{isKeyboardFocusEvent}from"../../../internal/focus-modality.js";import{finiteDuration,finiteNumber}from"../../../internal/numbers.js";import{omittedEmptyStringConverter,optionalLiteralSetConverter}from"../../../internal/converters.js";import{resolveEffectivePositioningStrategy}from"../../../internal/positioning-strategy.js";import{activateNonmodalOverlay,composedContains}from"../../../internal/nonmodal-overlay-manager.js";import{animateRegistered}from"../../../internal/registered-animation.js";import{composedAccessibilityTextResult}from"../../../internal/accessibility-visibility.js";import{applyOverlayArrow}from"./overlay-arrow.js";import{normalizeVirtualRect,observeOverlayAnchorIdentity,OverlayTransitionGate,resolveOverlayAnchor}from"./overlay-shared.js";import{tooltipStyles}from"./overlay.styles.js";import{LYRA_DEFAULT_popover}from"../../../internal/default-strings.generated.js";const DEFAULT_SHOW_DELAY=150,DEFAULT_HIDE_DELAY=0,DEFAULT_DISTANCE=8,MAX_SHADOW_CONTENT_SCAN_FRAMES=4;function safelyComposedContains(container,candidate){try{return candidate?.nodeType===1&&composedContains(container,candidate)}catch{return!1}}const TOOLTIP_POSITIONING_STRATEGY=optionalLiteralSetConverter(["absolute","fixed"]);class LyraTooltip extends LyraElement{constructor(){super(...arguments),this._open=!1,this.trigger="hover focus",this.manual=!1,this.showDelay=150,this.hideDelay=0,this.placement="top",this.distance=8,this.skidding=0,this._for="",this.anchor=null,this.disabled=!1,this.topLayer=!1,this.withoutArrow=!1,this.arrowPlacement="anchor",this.arrowPadding=0,this.content="",this.accessibleLabel="",this.namedTriggerMode=!0,this.interactiveContent=!1,this.resolvedSide="top",this.anchorPositioned=!1,this.popupHidden=!0,this.directionChanged=!1,this.observedDirectAnchorWasConnected=!1,this.placementPending=!1,this.restoreFocusOnClose=!1,this.suppressTriggerFocusOpen=!1,this.openedByPointer=!1,this.tooltipId=nextId("tooltip"),this.descriptionId=nextId("tooltip-description"),this.focusDescribesTrigger=!1,this.triggerSyncGeneration=0,this.contentSlotListeners=new Set,this.shadowContentScanAttempts=0,this.transitionToken=0,this.transitionGate=new OverlayTransitionGate,this.onTriggerSlotChange=event=>{this.syncNamedTriggerMode();const slot=event.target;this.slottedTriggerElement=slot.assignedElements({flatten:!0})[0],this.syncInteractionTrigger()},this.onEnter=event=>{if(!this.disabled){if(event.type==="focusin"){if(this.opensOn("focus")&&(this.focusDescribesTrigger=!0),this.syncTriggerA11y(),this.suppressTriggerFocusOpen||!this.opensOn("focus")||!isKeyboardFocusEvent(event))return}else{if(this.syncTriggerA11y(),!this.opensOn("hover"))return;this.openedByPointer=!0}this.requestTransition(!0)}},this.onLeave=event=>{if(event.type==="focusout"?!this.opensOn("focus"):!this.opensOn("hover"))return;const next=event.relatedTarget;next!==null&&next.nodeType===1&&this.triggerElement&&composedContains(this.triggerElement,next)||(event.type==="focusout"&&(this.focusDescribesTrigger=!1,this.syncTriggerA11y()),!(this.interactiveContent&&this.isPopupTarget(next))&&this.requestTransition(!1))},this.onTriggerClick=()=>{this.disabled||this.opensOn("click")&&(this.syncTriggerA11y(),this._open?this.hide():this.show())},this.onPopupEnter=()=>{!this.interactiveContent||this.isManual||(this.cancelPendingTransition(),this.show())},this.onPopupLeave=event=>{if(!this.interactiveContent||this.isManual)return;const next=event.relatedTarget;next!==null&&next.nodeType===1&&(this.triggerElement&&composedContains(this.triggerElement,next)||this.isPopupTarget(next))||this.requestTransition(!1)},this.onContentSlotChange=event=>{event.target?.localName==="slot"&&this.updateInteractiveContent()},this.onTriggerKeyDown=event=>{this.isManual||!this.open||event.key!=="Escape"||!this.overlayHandle?.isTopmost()||(event.preventDefault(),this.hide())}}static{this.defaultStrings={...super.defaultStrings,popover:LYRA_DEFAULT_popover}}static{this.styles=[LyraElement.styles,tooltipStyles]}get open(){return this._open}set open(next){const normalized=!!next;if(normalized||this.cancelPendingTransition(),normalized!==this._open){if(!this.hasUpdated){this.applyOpenState(normalized);return}normalized?this.show():this.hide()}}get for(){return this._for}set for(next){this._for=next??""}get positioningStrategy(){return this._positioningStrategy??"absolute"}set positioningStrategy(next){const normalized=TOOLTIP_POSITIONING_STRATEGY.normalize(next)??"absolute",old=this.positioningStrategy;this._positioningStrategy=normalized,normalized!==old&&(this.requestUpdate("positioningStrategy",old),old==="fixed"!=(normalized==="fixed")&&this.requestUpdate("hoist",old==="fixed"))}get hoist(){return this.positioningStrategy==="fixed"}set hoist(next){this.positioningStrategy=next?"fixed":"absolute"}get rendersArrow(){return!this.withoutArrow}get activeContentSlot(){const selector=this.namedTriggerMode?'[part~="body"] slot:not([name])':'[part~="body"] slot[name="content"]';return(this.renderRoot??this.shadowRoot)?.querySelector(selector)??null}syncNamedTriggerMode(schedule=!0){const children=Array.from(this.children),hasNamedTrigger=children.some(child=>child.getAttribute("slot")==="trigger"),hasShoelaceContent=(this.content??"").length>0||children.some(child=>child.getAttribute("slot")==="content"),next=hasNamedTrigger||!hasShoelaceContent;if(next===this.namedTriggerMode)return;const old=this.namedTriggerMode;this.namedTriggerMode=next,schedule&&this.hasUpdated&&this.requestUpdate("namedTriggerMode",old)}get triggerKeywords(){return new Set(String(this.trigger??"").trim().split(/\s+/).filter(Boolean))}get isManual(){const keywords=this.triggerKeywords;return this.manual||keywords.size===0||keywords.has("manual")}opensOn(keyword){return!this.isManual&&this.triggerKeywords.has(keyword)}willUpdate(changed){super.willUpdate(changed);const direction=this.effectiveDirection;this.directionChanged=direction!==this.positioningDirection,this.positioningDirection=direction,this.syncNamedTriggerMode(!1),(changed.has("manual")||changed.has("trigger"))&&this.isManual&&this.cancelPendingTransition(),(changed.has("manual")||changed.has("trigger"))&&this.focusDescribesTrigger&&!this.opensOn("focus")&&(this.focusDescribesTrigger=!1,this.syncTriggerA11y()),changed.has("disabled")&&this.disabled&&(this.cancelPendingTransition(),this.focusDescribesTrigger&&(this.focusDescribesTrigger=!1,this.syncTriggerA11y()),this._open&&(this.hasUpdated?this.hide():this.applyOpenState(!1))),changed.has("anchor")&&changed.get("anchor")===this.observedDirectAnchor&&this.observedDirectAnchorWasConnected&&this.anchor?.isConnected!==!0&&this.open&&!this.resolveAnchor()&&this.forceClose(),changed.has("showDelay")&&this.pendingDirection==="show"&&this.requestTransition(!0),changed.has("hideDelay")&&this.pendingDirection==="hide"&&this.requestTransition(!1),changed.has("for")&&this.syncInteractionTrigger(),changed.has("open")&&!this.open&&(this.anchorPositioned=!1),changed.has("open")&&this.open&&(this.popupHidden=!1),(changed.has("anchor")||changed.has("for"))&&(this.anchorPositioned=!1)}updated(changed){if(super.updated(changed),(changed.has("for")||changed.has("anchor")||changed.has("open"))&&this.syncAnchorIdentityObservation(),this.directionChanged||changed.has("open")||changed.has("placement")||changed.has("distance")||changed.has("skidding")||changed.has("for")||changed.has("anchor")||changed.has("positioningStrategy")||changed.has("topLayer")||changed.has("arrow")||changed.has("withoutArrow")||changed.has("arrowPlacement")||changed.has("arrowPadding")||changed.has("interactiveContent")){if(this.cleanup?.(),this.cleanup=void 0,this.open&&this.isConnected&&this.position(),changed.has("open"))if(this.open)this.updateInteractiveContent(),this.isConnected&&this.requiresOverlayManager&&this.activateTooltipOverlay();else{this.positionedAnchor=void 0;const restoreFocus=this.restoreFocusOnClose;this.suppressTriggerFocusOpen=restoreFocus;try{this.overlayHandle?.deactivate({restoreFocus})}finally{this.suppressTriggerFocusOpen=!1}this.overlayHandle=void 0,this.restoreFocusOnClose=!1,this.virtualAnchor=void 0,this.returnFocusTo=void 0,this.syncInteractionTrigger()}else changed.has("interactiveContent")&&this.open&&this.isConnected&&(this.requiresOverlayManager?this.activateTooltipOverlay():(this.overlayHandle?.deactivate({restoreFocus:!1}),this.overlayHandle=void 0));this.syncTriggerA11y()}(changed.has("content")||changed.has("accessibleLabel"))&&this.updateDescriptionProxy()}connectedCallback(){super.connectedCallback();const triggerSyncGeneration=++this.triggerSyncGeneration,triggerSyncDocument=this.ownerDocument;this.syncAnchorIdentityObservation(),this.ensureDescriptionProxy(),this.contentObserver?.disconnect();const MutationObserverCtor=this.ownerDocument.defaultView?.MutationObserver;this.contentObserver=MutationObserverCtor?new MutationObserverCtor(()=>{this.syncNamedTriggerMode(),this.updateInteractiveContent()}):void 0,this.updateInteractiveContent(),this.syncInteractionTrigger(),this.updateComplete.then(()=>{if(triggerSyncGeneration!==this.triggerSyncGeneration||!this.isConnected||this.ownerDocument!==triggerSyncDocument)return;const slot=this.renderRoot.querySelector('[part="trigger"] > slot');this.slottedTriggerElement=slot?.assignedElements({flatten:!0})[0],this.syncInteractionTrigger()}),this.hasUpdated&&this.open&&(this.popupHidden=!1,this.position(),this.requiresOverlayManager&&(this.overlayHandle?.isActive()?this.overlayHandle.resume():this.activateTooltipOverlay()))}disconnectedCallback(){this.triggerSyncGeneration++,this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.cancelPendingTransition(),this.cleanup?.(),this.cleanup=void 0,this.overlayHandle?.suspend(),this.triggerElement&&this.unbindTrigger(this.triggerElement),this.releaseTriggerA11y(),this.focusDescribesTrigger=!1,this.triggerElement=void 0,this.contentObserver?.disconnect(),this.contentObserver=void 0,this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.clearContentSlotListeners(),this.cancelShadowContentScan(),this.transitionToken++,this.cancelTransitionAnimation(),this.removeAttribute("data-closing"),this.popupHidden=!0,super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.triggerSyncGeneration++,this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.cancelPendingTransition(),this.cancelShadowContentScan(),this.contentObserver?.disconnect(),this.contentObserver=void 0,this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.clearContentSlotListeners(),this.releaseTriggerA11y()}syncAnchorIdentityObservation(){this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0;const directAnchor=this.open?this.anchor??void 0:void 0;if(this.observedDirectAnchor=directAnchor,this.observedDirectAnchorWasConnected=directAnchor?.isConnected===!0,!this.isConnected||!this.for&&!directAnchor)return;const onIdentityChange=()=>{const directAnchorRemoved=this.anchor===this.observedDirectAnchor&&this.observedDirectAnchorWasConnected&&this.observedDirectAnchor?.isConnected===!1;if(this.observedDirectAnchorWasConnected=this.observedDirectAnchor?.isConnected===!0,this.syncInteractionTrigger(),!this.open)return;const nextAnchor=this.resolveAnchor();if(directAnchorRemoved&&!nextAnchor){this.forceClose();return}nextAnchor!==this.positionedAnchor&&this.position()},observedRoots=new Set([this]);directAnchor&&directAnchor.getRootNode()!==this.getRootNode()&&observedRoots.add(directAnchor.isConnected?directAnchor:directAnchor.ownerDocument);const cleanups=[...observedRoots].map(root=>observeOverlayAnchorIdentity(root,onIdentityChange));this.stopAnchorIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}resolveForTrigger(){if(!this.for)return;const target=this.getRootNode().getElementById?.(this.for)??null,HTMLElementCtor=target?.ownerDocument.defaultView?.HTMLElement;return target&&HTMLElementCtor&&target instanceof HTMLElementCtor?target:void 0}syncInteractionTrigger(){const next=this.virtualAnchor?void 0:this.slottedTriggerElement??this.resolveForTrigger();this.adoptTrigger(next)}activateTooltipOverlay(){if(!this.isConnected)return;const restoreFocusTarget=this.virtualAnchor?this.returnFocusTo??null:this.accessibleTrigger;if(this.overlayHandle?.isActive()){this.overlayHandle.updateRestoreFocusTo(restoreFocusTarget);return}this.overlayHandle=activateNonmodalOverlay({host:this,panel:()=>this.renderRoot.querySelector('[part~="popup"]'),onEscape:()=>this.hide({restoreFocus:this.shouldRestoreFocusAfterEscape()}),restoreFocusTo:restoreFocusTarget}),this.overlayHandle.focusAutofocus()}shouldRestoreFocusAfterEscape(){if(this.virtualAnchor)return this.returnFocusTo!==void 0;const active=deepActiveElementIn(this.ownerDocument);return safelyComposedContains(this,active)}get requiresOverlayManager(){return this.open}showAt(rect,options){const normalizedRect=normalizeVirtualRect(rect);if(!normalizedRect)return;const previousAnchor=this.virtualAnchor,previousReturnFocusTo=this.returnFocusTo;if(this.virtualAnchor=virtualAnchorFromRect(normalizedRect),this.returnFocusTo=options?.returnFocusTo,this.syncInteractionTrigger(),this.open){this.activateTooltipOverlay(),this.position();return}this.show(),!this.open&&(this.virtualAnchor=previousAnchor,this.returnFocusTo=previousReturnFocusTo,this.syncInteractionTrigger())}show(){return this.cancelPendingTransition(),this.disabled||this._open?Promise.resolve():this.transitionGate.request(!0,()=>{if(this.emit("lr-show",null,{cancelable:!0}).defaultPrevented){this.syncOpenAttribute();return}return this.cancelTransitionAnimation(),this.removeAttribute("data-closing"),this.applyOpenState(!0),this.settleTransition("lr-after-show")})}hide(options){return this.cancelPendingTransition(),this._open?this.transitionGate.request(!1,()=>{if(this.emit("lr-hide",null,{cancelable:!0}).defaultPrevented){this.syncOpenAttribute();return}return options?.restoreFocus&&(this.restoreFocusOnClose=!0),this.cancelTransitionAnimation(),this.isConnected&&this.setAttribute("data-closing",""),this.applyOpenState(!1),this.settleTransition("lr-after-hide")}):Promise.resolve()}forceClose(){return this.cancelPendingTransition(),this._open?(this.cancelTransitionAnimation(),this.isConnected&&this.setAttribute("data-closing",""),this.applyOpenState(!1),this.settleTransition("lr-after-hide")):Promise.resolve()}applyOpenState(next){const old=this._open;this._open=next,next||(this.cancelShadowContentScan(),this.placementPending=!1),next||(this.openedByPointer=!1),this.requestUpdate("open",old)}syncOpenAttribute(){this.toggleAttribute("open",this._open)}cancelTransitionAnimation(){this.transitionAnimation?.cancel(),this.transitionAnimation=void 0}async settleTransition(event){const token=++this.transitionToken;if(await this.updateComplete,this.transitionToken===token){if(event==="lr-after-show"){const positioned=await waitForDeferredPlacement(()=>this.cleanup);if(this.transitionToken!==token||!this.open)return;if(!positioned){await this.forceClose();return}if(await this.updateComplete,this.transitionToken!==token)return}if(this.isConnected){const popup=this.renderRoot.querySelector('[part~="popup"]'),showing=event==="lr-after-show",animation=popup?animateRegistered(this,popup,`tooltip.${showing?"show":"hide"}`,this.effectiveDirection,{keyframes:showing?[{opacity:0},{opacity:1}]:[{opacity:1},{opacity:0}],durationProperties:["--lr-transition-fast","--lr-duration-fast"],easingProperties:["--lr-easing-standard"]}):void 0;if(this.transitionAnimation=animation,await animation?.finished.catch(()=>{}),this.transitionToken!==token)return;this.cancelTransitionAnimation()}event==="lr-after-hide"&&(this.removeAttribute("data-closing"),this.popupHidden=!0,await this.updateComplete,this.transitionToken!==token)||this.emit(event)}}resolveAnchor(){return resolveOverlayAnchor(this,{virtualAnchor:this.virtualAnchor,anchor:this.anchor,for:this.for,trigger:this.triggerElement})}position(){this.cleanup?.(),this.cleanup=void 0;const popup=this.renderRoot.querySelector('[part~="popup"]'),arrowElement=this.renderRoot.querySelector('[part~="arrow"]'),anchor=this.resolveAnchor();if(!this.open||!anchor||!popup){this.positionedAnchor=void 0,this.anchorPositioned=!1,this.placementPending=!1;return}if(anchor!==this.positionedAnchor&&(this.anchorPositioned=!1),this.open&&anchor&&popup){const arrowPadding=Math.max(0,finiteNumber(this.arrowPadding,0));this.placementPending=!0,this.placedTopLayer=syncTopLayerRelease(popup,this.placedTopLayer,this.topLayer),this.cleanup=place(anchor,popup,{placement:rtlAwarePlacement(this.placement,this),...topLayerPlacement(this.topLayer,resolveEffectivePositioningStrategy(this,this._positioningStrategy,"absolute")),offset:finiteNumber(this.distance,DEFAULT_DISTANCE),skidding:finiteNumber(this.skidding,0),arrow:this.rendersArrow&&arrowElement?arrowElement:void 0,arrowPadding,onPlaced:({placement,arrow})=>{this.placementPending=!1,this.positionedAnchor=anchor,this.anchorPositioned=!0;const side=applyOverlayArrow(arrowElement,{placement,coords:arrow,enabled:this.rendersArrow,arrowPlacement:this.arrowPlacement,arrowPadding,rtl:this.effectiveDirection==="rtl",sizeProperty:"--arrow-size",fallbackSizeProperty:"--lr-tooltip-arrow-size"});side!==this.resolvedSide&&(this.resolvedSide=side)}})}}syncTriggerA11y(){const trigger=this.triggerElement??null,proxy=this.open||this.focusDescribesTrigger?this.descriptionProxy:void 0,contribution={descriptions:proxy?[proxy]:[]};this.triggerAria?this.triggerAria.update(trigger,contribution):this.triggerAria=acquireAriaOwnership(trigger,contribution);const accessibleTrigger=this.accessibleTrigger,distinctAccessibleTrigger=accessibleTrigger!==trigger?accessibleTrigger:null;this.accessibleTriggerAria?this.accessibleTriggerAria.update(distinctAccessibleTrigger,contribution):this.accessibleTriggerAria=acquireAriaOwnership(distinctAccessibleTrigger,contribution),this.overlayHandle?.isActive()&&!this.virtualAnchor&&this.overlayHandle.updateRestoreFocusTo(accessibleTrigger)}get accessibleTrigger(){return this.triggerElement?resolveAccessibleTrigger(this.triggerElement):null}releaseTriggerA11y(){this.accessibleTriggerAria?.release(),this.accessibleTriggerAria=void 0,this.triggerAria?.release(),this.triggerAria=void 0}requestTransition(next){if(this.cancelPendingTransition(),this.disabled)return;const delay=this.interactionDelay(next);if(delay<=0){next?this.show():this.hide();return}this.pendingDirection=next?"show":"hide";const view=this.ownerDocument.defaultView;if(!view){this.pendingDirection=void 0;return}this.timerView=view;const timer=view.setTimeout(()=>{this.timerView!==view||this.timer!==timer||(this.timer=void 0,this.timerView=void 0,this.pendingDirection=void 0,next?this.show():this.hide())},delay);this.timer=timer}interactionDelay(showing){const value=showing?this.showDelay:this.hideDelay,fallback=showing?DEFAULT_SHOW_DELAY:DEFAULT_HIDE_DELAY,attribute=showing?"show-delay":"hide-delay";if(this.hasAttribute(attribute)||value!==fallback)return finiteDuration(value,fallback);const property2=showing?"--show-delay":"--hide-delay",match=(this.ownerDocument.defaultView?.getComputedStyle(this).getPropertyValue(property2).trim()??"").match(/^(-?(?:\d+\.?\d*|\.\d+))(ms|s)$/i);if(!match)return fallback;const amount=Number(match[1]),milliseconds=match[2]?.toLowerCase()==="s"?amount*1e3:amount;return finiteDuration(milliseconds,fallback)}cancelPendingTransition(){this.timer!==void 0&&this.timerView?.clearTimeout(this.timer),this.timer=void 0,this.timerView=void 0,this.pendingDirection=void 0}bindTrigger(trigger){trigger.addEventListener("mouseenter",this.onEnter),trigger.addEventListener("mouseleave",this.onLeave),trigger.addEventListener("focusin",this.onEnter),trigger.addEventListener("focusout",this.onLeave),trigger.addEventListener("click",this.onTriggerClick),trigger.addEventListener("keydown",this.onTriggerKeyDown)}unbindTrigger(trigger){trigger.removeEventListener("mouseenter",this.onEnter),trigger.removeEventListener("mouseleave",this.onLeave),trigger.removeEventListener("focusin",this.onEnter),trigger.removeEventListener("focusout",this.onLeave),trigger.removeEventListener("click",this.onTriggerClick),trigger.removeEventListener("keydown",this.onTriggerKeyDown),this.focusDescribesTrigger=!1}isTriggerHeld(trigger){try{if(trigger.matches(":hover"))return!0}catch{}const active=deepActiveElementIn(trigger.ownerDocument);return safelyComposedContains(trigger,active)}adoptTrigger(next){if(next===this.triggerElement){this.syncTriggerA11y();return}const hadTrigger=this.triggerElement!==void 0;if(this.cancelPendingTransition(),this.triggerElement&&this.unbindTrigger(this.triggerElement),this.triggerElement=next,!this.triggerElement){this.syncTriggerA11y(),hadTrigger&&this.open&&!this.resolveAnchor()&&this.forceClose();return}this.bindTrigger(this.triggerElement),this.syncTriggerA11y(),hadTrigger&&this._open&&this.openedByPointer&&!this.isTriggerHeld(this.triggerElement)&&this.forceClose(),this.open&&this.position(),this.open&&this.interactiveContent&&this.activateTooltipOverlay()}isPopupTarget(target){if(target===null||target.nodeType!==1)return!1;const element=target,slot=this.activeContentSlot;return this.renderRoot.querySelector('[part~="popup"]')?.contains(element)===!0||slot?.assignedElements({flatten:!0}).some(root=>composedContains(root,element))===!0}clearContentSlotListeners(){for(const slot of this.contentSlotListeners)slot.removeEventListener("slotchange",this.onContentSlotChange);this.contentSlotListeners.clear()}syncContentSlotListeners(slots){const activeSlot=this.activeContentSlot;for(const slot of this.contentSlotListeners)slots.has(slot)&&slot!==activeSlot||(slot.removeEventListener("slotchange",this.onContentSlotChange),this.contentSlotListeners.delete(slot));for(const slot of slots)slot===activeSlot||this.contentSlotListeners.has(slot)||(slot.addEventListener("slotchange",this.onContentSlotChange),this.contentSlotListeners.add(slot))}inspectContent(){const snapshot={actionable:!1,assigned:!1,awaitingShadowRoot:!1,labelReferenceRoots:new Set,text:"",externalRoots:new Set,shadowRoots:new Set,forwardingSlots:new Set,composedAncestors:new Set},activeSlot=this.activeContentSlot;if(!activeSlot)return snapshot;const renderRoot=this.renderRoot??this.shadowRoot;snapshot.assigned=activeSlot.assignedNodes().length>0;const popup=renderRoot?.querySelector('[part~="popup"]'),bypassClosedVisibility=popup?.hasAttribute("data-hidden")===!0||this.placementPending,previousVisibility=popup?.style.getPropertyValue("visibility")??"",previousVisibilityPriority=popup?.style.getPropertyPriority("visibility")??"",previousHidden=popup?.hidden??!1;if(popup&&bypassClosedVisibility){const hostVisibility=this.ownerDocument.defaultView?.getComputedStyle(this).visibility??"visible";popup.style.setProperty("visibility",hostVisibility),popup.hidden=!1}try{const visitedContentElements=new Set,accessibilityText=composedAccessibilityTextResult(activeSlot,{shouldPruneNode:node=>{if(node.getRootNode()!==renderRoot&&!this.contains(node)&&snapshot.externalRoots.add(node),node.nodeType!==1)return!1;const element=node;return visitedContentElements.add(element),!isAccessibilitySubtreeExcluded(element)&&!isAccessibilityVisibilityHidden(element)&&isActionableElement(element)&&(snapshot.actionable=!0),element.localName==="slot"&&snapshot.forwardingSlots.add(element),element.shadowRoot?snapshot.shadowRoots.add(element.shadowRoot):element.localName.includes("-")&&(snapshot.awaitingShadowRoot=!0),!1},isSubtreeExcluded:element=>(!visitedContentElements.has(element)&&element!==this&&snapshot.composedAncestors.add(element),isAccessibilitySubtreeExcluded(element))});snapshot.text=accessibilityText.text.replace(/\s+/g," ").trim();for(const root of accessibilityText.labelReferenceRoots)snapshot.labelReferenceRoots.add(root);for(const reference of accessibilityText.referencedElements)snapshot.externalRoots.add(reference)}finally{popup&&bypassClosedVisibility&&(previousVisibility?popup.style.setProperty("visibility",previousVisibility,previousVisibilityPriority):popup.style.removeProperty("visibility"),popup.hidden=previousHidden)}return snapshot}observeContentNode(node){if(this.contentObserver){if(node.nodeType===3){this.contentObserver.observe(node,{characterData:!0});return}node.nodeType!==1&&node.nodeType!==11||this.contentObserver.observe(node,{attributes:!0,attributeFilter:["aria-hidden","aria-label","aria-labelledby","alt","class","contenteditable","hidden","href","inert","open","role","slot","style","tabindex"],childList:!0,characterData:!0,subtree:!0})}}bindContentObservation(snapshot){if(this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.isConnected&&snapshot.labelReferenceRoots.size>0){const cleanups=[...snapshot.labelReferenceRoots].map(root=>observeOverlayAnchorIdentity(root,()=>this.updateInteractiveContent()));this.stopLabelReferenceIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}if(!this.contentObserver)return;const pendingRecords=this.contentObserver.takeRecords();this.contentObserver.disconnect(),pendingRecords.length>0&&queueMicrotask(()=>this.updateInteractiveContent());const ancestorFilter={attributes:!0,attributeFilter:["aria-hidden","class","hidden","inert","style"]};for(const ancestor of snapshot.composedAncestors)ancestor===this||ancestor.getRootNode()===this.renderRoot||snapshot.externalRoots.has(ancestor)||this.contentObserver.observe(ancestor,ancestorFilter);for(let ancestor=composedParentElement(this),hops=0;ancestor&&hops<64;ancestor=composedParentElement(ancestor),hops++)this.contentObserver.observe(ancestor,ancestorFilter);this.observeContentNode(this);for(const root of snapshot.externalRoots)this.observeContentNode(root);for(const root of snapshot.shadowRoots)this.observeContentNode(root)}updateInteractiveContent(fromShadowContentScan=!1){fromShadowContentScan||(this.shadowContentScanAttempts=0);const snapshot=this.inspectContent();this.interactiveContent=snapshot.actionable,this.syncContentSlotListeners(snapshot.forwardingSlots),this.bindContentObservation(snapshot),this.scheduleShadowContentScan(snapshot.awaitingShadowRoot),this.updateDescriptionProxy(snapshot.text,snapshot.assigned)}scheduleShadowContentScan(awaitingShadowRoot){if(this.cancelShadowContentScan(!1),!awaitingShadowRoot||!this.open||!this.isConnected||this.shadowContentScanAttempts>=MAX_SHADOW_CONTENT_SCAN_FRAMES)return;const view=this.ownerDocument.defaultView;view&&(this.shadowContentScanView=view,this.shadowContentScanFrame=view.requestAnimationFrame(()=>{this.shadowContentScanFrame=void 0,this.shadowContentScanView=void 0,this.shadowContentScanAttempts++,this.updateInteractiveContent(!0)}))}cancelShadowContentScan(resetAttempts=!0){this.shadowContentScanFrame!==void 0&&this.shadowContentScanView?.cancelAnimationFrame(this.shadowContentScanFrame),this.shadowContentScanFrame=void 0,this.shadowContentScanView=void 0,resetAttempts&&(this.shadowContentScanAttempts=0)}ensureDescriptionProxy(){this.descriptionProxy||(this.descriptionProxy=this.ownerDocument.createElement("span"),this.descriptionProxy.id=this.descriptionId,this.descriptionProxy.slot="__lr-tooltip-description",this.descriptionProxy.hidden=!0,this.descriptionProxy.dataset.lyraTooltipDescription=""),this.descriptionProxy.parentElement!==this&&this.append(this.descriptionProxy),this.updateDescriptionProxy()}updateDescriptionProxy(contentText,assigned){if(!this.descriptionProxy)return;const hostLabel=this.getAttribute("aria-label"),snapshot=contentText===void 0||assigned===void 0?this.inspectContent():void 0,visibleContent=contentText??snapshot?.text??"",hasAssignment=assigned??snapshot?.assigned??!1,description=hostLabel!==null?hostLabel.trim():(this.accessibleLabel||visibleContent||(hasAssignment?"":this.content)).trim();this.descriptionProxy.textContent!==description&&(this.descriptionProxy.textContent=description)}render(){const hostLabel=this.getAttribute("aria-label"),propertyLabel=this.accessibleLabel??"",hasExplicitLabel=hostLabel!==null||propertyLabel.length>0,label=hostLabel!==null?hostLabel:propertyLabel,popupLabel=this.interactiveContent?hasExplicitLabel?label:this.localize("popover"):hasExplicitLabel?label:nothing;return html`
1
+ import{__decorate}from"tslib";import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{isAccessibilitySubtreeExcluded,isAccessibilityVisibilityHidden,nextId,resolveAccessibleTrigger}from"../../../internal/a11y.js";import{acquireAriaOwnership}from"../../../internal/aria-ownership.js";import{isActionableElement}from"../../../internal/focus-navigation.js";import{deferredPlaceReady as place,syncTopLayerRelease,topLayerPlacement,waitForDeferredPlacement}from"../../../internal/anchored-overlay-runtime.js";import{virtualAnchorFromRect}from"../../../internal/positioner-geometry.js";import{rtlAwarePlacement}from"../../../internal/rtl.js";import{composedParentElement,deepActiveElementIn}from"../../../internal/active-element.js";import{isKeyboardFocusEvent}from"../../../internal/focus-modality.js";import{finiteDuration,finiteNumber}from"../../../internal/numbers.js";import{omittedEmptyStringConverter,optionalLiteralSetConverter}from"../../../internal/converters.js";import{resolveEffectivePositioningStrategy}from"../../../internal/positioning-strategy.js";import{activateNonmodalOverlay,composedContains}from"../../../internal/nonmodal-overlay-manager.js";import{animateRegistered}from"../../../internal/registered-animation.js";import{composedAccessibilityTextResult}from"../../../internal/accessibility-visibility.js";import{applyOverlayArrow}from"./overlay-arrow.js";import{normalizeVirtualRect,observeOverlayAnchorIdentity,OverlayTransitionGate,resolveOverlayAnchor}from"./overlay-shared.js";import{tooltipStyles}from"./overlay.styles.js";import{LYRA_DEFAULT_popover}from"../../../internal/default-strings.generated.js";const DEFAULT_SHOW_DELAY=150,DEFAULT_HIDE_DELAY=0,DEFAULT_DISTANCE=8,MAX_SHADOW_CONTENT_SCAN_FRAMES=4;function safelyComposedContains(container,candidate){try{return candidate?.nodeType===1&&composedContains(container,candidate)}catch{return!1}}const TOOLTIP_POSITIONING_STRATEGY=optionalLiteralSetConverter(["absolute","fixed"]);class LyraTooltip extends LyraElement{constructor(){super(...arguments),this._open=!1,this.trigger="hover focus",this.manual=!1,this.showDelay=150,this.hideDelay=0,this.placement="top",this.distance=8,this.skidding=0,this._for="",this.anchor=null,this.disabled=!1,this.topLayer=!1,this.withoutArrow=!1,this.arrowPlacement="anchor",this.arrowPadding=0,this.content="",this.accessibleLabel="",this.namedTriggerMode=!0,this.interactiveContent=!1,this.resolvedSide="top",this.anchorPositioned=!1,this.popupHidden=!0,this.directionChanged=!1,this.observedDirectAnchorWasConnected=!1,this.placementPending=!1,this.restoreFocusOnClose=!1,this.suppressTriggerFocusOpen=!1,this.openedByPointer=!1,this.tooltipId=nextId("tooltip"),this.descriptionId=nextId("tooltip-description"),this.focusDescribesTrigger=!1,this.triggerSyncGeneration=0,this.contentSlotListeners=new Set,this.shadowContentScanAttempts=0,this.transitionToken=0,this.transitionGate=new OverlayTransitionGate,this.onTriggerSlotChange=event=>{this.syncNamedTriggerMode();const slot=event.target;this.slottedTriggerElement=slot.assignedElements({flatten:!0})[0],this.syncInteractionTrigger()},this.onEnter=event=>{if(!this.disabled){if(event.type==="focusin"){if(this.opensOn("focus")&&(this.focusDescribesTrigger=!0),this.syncTriggerA11y(),this.suppressTriggerFocusOpen||!this.opensOn("focus")||!isKeyboardFocusEvent(event))return}else{if(this.syncTriggerA11y(),!this.opensOn("hover"))return;this.openedByPointer=!0}this.requestTransition(!0)}},this.onLeave=event=>{if(event.type==="focusout"?!this.opensOn("focus"):!this.opensOn("hover"))return;const next=event.relatedTarget;next!==null&&next.nodeType===1&&this.triggerElement&&composedContains(this.triggerElement,next)||(event.type==="focusout"&&(this.focusDescribesTrigger=!1,this.syncTriggerA11y()),!(this.interactiveContent&&this.isPopupTarget(next))&&this.requestTransition(!1))},this.onTriggerClick=()=>{this.disabled||this.opensOn("click")&&(this.syncTriggerA11y(),this._open?this.hide():this.show())},this.onPopupEnter=()=>{!this.interactiveContent||this.isManual||(this.cancelPendingTransition(),this.show())},this.onPopupLeave=event=>{if(!this.interactiveContent||this.isManual)return;const next=event.relatedTarget;next!==null&&next.nodeType===1&&(this.triggerElement&&composedContains(this.triggerElement,next)||this.isPopupTarget(next))||this.requestTransition(!1)},this.onContentSlotChange=event=>{event.target?.localName==="slot"&&this.updateInteractiveContent()},this.onTriggerKeyDown=event=>{this.isManual||!this.open||event.key!=="Escape"||!this.overlayHandle?.isTopmost()||(event.preventDefault(),this.hide())}}static{this.defaultStrings={...super.defaultStrings,popover:LYRA_DEFAULT_popover}}static{this.styles=[LyraElement.styles,tooltipStyles]}get open(){return this._open}set open(next){const normalized=!!next;if(normalized||this.cancelPendingTransition(),normalized!==this._open){if(!this.hasUpdated){this.applyOpenState(normalized);return}normalized?this.show():this.hide()}}get for(){return this._for}set for(next){this._for=next??""}get positioningStrategy(){return this._positioningStrategy??"absolute"}set positioningStrategy(next){const normalized=TOOLTIP_POSITIONING_STRATEGY.normalize(next)??"absolute",old=this.positioningStrategy;this._positioningStrategy=normalized,normalized!==old&&(this.requestUpdate("positioningStrategy",old),old==="fixed"!=(normalized==="fixed")&&this.requestUpdate("hoist",old==="fixed"))}get hoist(){return this.positioningStrategy==="fixed"}set hoist(next){this.positioningStrategy=next?"fixed":"absolute"}get rendersArrow(){return!this.withoutArrow}get activeContentSlot(){const selector=this.namedTriggerMode?'[part~="body"] slot:not([name])':'[part~="body"] slot[name="content"]';return(this.renderRoot??this.shadowRoot)?.querySelector(selector)??null}syncNamedTriggerMode(schedule=!0){const children=Array.from(this.children),hasNamedTrigger=children.some(child=>child.getAttribute("slot")==="trigger"),hasShoelaceContent=(this.content??"").length>0||children.some(child=>child.getAttribute("slot")==="content"),next=hasNamedTrigger||!hasShoelaceContent;if(next===this.namedTriggerMode)return;const old=this.namedTriggerMode;this.namedTriggerMode=next,schedule&&this.hasUpdated&&this.requestUpdate("namedTriggerMode",old)}get triggerKeywords(){return new Set(String(this.trigger??"").trim().split(/\s+/).filter(Boolean))}get isManual(){const keywords=this.triggerKeywords;return this.manual||keywords.size===0||keywords.has("manual")}opensOn(keyword){return!this.isManual&&this.triggerKeywords.has(keyword)}willUpdate(changed){super.willUpdate(changed);const direction=this.effectiveDirection;this.directionChanged=direction!==this.positioningDirection,this.positioningDirection=direction,this.syncNamedTriggerMode(!1),(changed.has("manual")||changed.has("trigger"))&&this.isManual&&this.cancelPendingTransition(),(changed.has("manual")||changed.has("trigger"))&&this.focusDescribesTrigger&&!this.opensOn("focus")&&(this.focusDescribesTrigger=!1,this.syncTriggerA11y()),changed.has("disabled")&&this.disabled&&(this.cancelPendingTransition(),this.focusDescribesTrigger&&(this.focusDescribesTrigger=!1,this.syncTriggerA11y()),this._open&&(this.hasUpdated?this.hide():this.applyOpenState(!1))),changed.has("anchor")&&changed.get("anchor")===this.observedDirectAnchor&&this.observedDirectAnchorWasConnected&&this.anchor?.isConnected!==!0&&this.open&&!this.resolveAnchor()&&this.forceClose(),changed.has("showDelay")&&this.pendingDirection==="show"&&this.requestTransition(!0),changed.has("hideDelay")&&this.pendingDirection==="hide"&&this.requestTransition(!1),changed.has("for")&&this.syncInteractionTrigger(),changed.has("open")&&!this.open&&(this.anchorPositioned=!1),changed.has("open")&&this.open&&(this.popupHidden=!1),(changed.has("anchor")||changed.has("for"))&&(this.anchorPositioned=!1)}updated(changed){if(super.updated(changed),(changed.has("for")||changed.has("anchor")||changed.has("open"))&&this.syncAnchorIdentityObservation(),this.directionChanged||changed.has("open")||changed.has("placement")||changed.has("distance")||changed.has("skidding")||changed.has("for")||changed.has("anchor")||changed.has("positioningStrategy")||changed.has("topLayer")||changed.has("arrow")||changed.has("withoutArrow")||changed.has("arrowPlacement")||changed.has("arrowPadding")||changed.has("interactiveContent")){if(this.cleanup?.(),this.cleanup=void 0,this.open&&this.isConnected&&this.position(),changed.has("open"))if(this.open)this.updateInteractiveContent(),this.isConnected&&this.requiresOverlayManager&&this.activateTooltipOverlay();else{this.positionedAnchor=void 0;const restoreFocus=this.restoreFocusOnClose;this.suppressTriggerFocusOpen=restoreFocus;try{this.overlayHandle?.deactivate({restoreFocus})}finally{this.suppressTriggerFocusOpen=!1}this.overlayHandle=void 0,this.restoreFocusOnClose=!1,this.virtualAnchor=void 0,this.returnFocusTo=void 0,this.syncInteractionTrigger()}else changed.has("interactiveContent")&&this.open&&this.isConnected&&(this.requiresOverlayManager?this.activateTooltipOverlay():(this.overlayHandle?.deactivate({restoreFocus:!1}),this.overlayHandle=void 0));this.syncTriggerA11y()}(changed.has("content")||changed.has("accessibleLabel"))&&this.updateDescriptionProxy()}connectedCallback(){super.connectedCallback();const triggerSyncGeneration=++this.triggerSyncGeneration,triggerSyncDocument=this.ownerDocument;this.syncAnchorIdentityObservation(),this.ensureDescriptionProxy(),this.contentObserver?.disconnect();const MutationObserverCtor=this.ownerDocument.defaultView?.MutationObserver;this.contentObserver=MutationObserverCtor?new MutationObserverCtor(()=>{this.syncNamedTriggerMode(),this.updateInteractiveContent()}):void 0,this.updateInteractiveContent(),this.syncInteractionTrigger(),this.updateComplete.then(()=>{if(triggerSyncGeneration!==this.triggerSyncGeneration||!this.isConnected||this.ownerDocument!==triggerSyncDocument)return;const slot=this.renderRoot.querySelector('[part="trigger"] > slot');this.slottedTriggerElement=slot?.assignedElements({flatten:!0})[0],this.syncInteractionTrigger()}),this.hasUpdated&&this.open&&(this.popupHidden=!1,this.position(),this.requiresOverlayManager&&(this.overlayHandle?.isActive()?this.overlayHandle.resume():this.activateTooltipOverlay()))}disconnectedCallback(){this.triggerSyncGeneration++,this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.cancelPendingTransition(),this.cleanup?.(),this.cleanup=void 0,this.overlayHandle?.suspend(),this.triggerElement&&this.unbindTrigger(this.triggerElement),this.releaseTriggerA11y(),this.focusDescribesTrigger=!1,this.triggerElement=void 0,this.contentObserver?.disconnect(),this.contentObserver=void 0,this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.clearContentSlotListeners(),this.cancelShadowContentScan(),this.transitionToken++,this.cancelTransitionAnimation(),this.removeAttribute("data-closing"),this.popupHidden=!0,super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.triggerSyncGeneration++,this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.cancelPendingTransition(),this.cancelShadowContentScan(),this.contentObserver?.disconnect(),this.contentObserver=void 0,this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.clearContentSlotListeners(),this.releaseTriggerA11y()}syncAnchorIdentityObservation(){this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0;const directAnchor=this.open?this.anchor??void 0:void 0;if(this.observedDirectAnchor=directAnchor,this.observedDirectAnchorWasConnected=directAnchor?.isConnected===!0,!this.isConnected||!this.for&&!directAnchor)return;const onIdentityChange=()=>{const directAnchorRemoved=this.anchor===this.observedDirectAnchor&&this.observedDirectAnchorWasConnected&&this.observedDirectAnchor?.isConnected===!1;if(this.observedDirectAnchorWasConnected=this.observedDirectAnchor?.isConnected===!0,this.syncInteractionTrigger(),!this.open)return;const nextAnchor=this.resolveAnchor();if(directAnchorRemoved&&!nextAnchor){this.forceClose();return}nextAnchor!==this.positionedAnchor&&this.position()},observedRoots=new Set([this]);directAnchor&&directAnchor.getRootNode()!==this.getRootNode()&&observedRoots.add(directAnchor.isConnected?directAnchor:directAnchor.ownerDocument);const cleanups=[...observedRoots].map(root=>observeOverlayAnchorIdentity(root,onIdentityChange));this.stopAnchorIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}resolveForTrigger(){if(!this.for)return;const target=this.getRootNode().getElementById?.(this.for)??null,HTMLElementCtor=target?.ownerDocument.defaultView?.HTMLElement;return target&&HTMLElementCtor&&target instanceof HTMLElementCtor?target:void 0}syncInteractionTrigger(){const next=this.virtualAnchor?void 0:this.slottedTriggerElement??this.resolveForTrigger();this.adoptTrigger(next)}activateTooltipOverlay(){if(!this.isConnected)return;const restoreFocusTarget=this.virtualAnchor?this.returnFocusTo??null:this.accessibleTrigger;if(this.overlayHandle?.isActive()){this.overlayHandle.updateRestoreFocusTo(restoreFocusTarget);return}this.overlayHandle=activateNonmodalOverlay({host:this,panel:()=>this.renderRoot.querySelector('[part~="popup"]'),onEscape:()=>this.hide({restoreFocus:this.shouldRestoreFocusAfterEscape()}),restoreFocusTo:restoreFocusTarget}),this.overlayHandle.focusAutofocus()}shouldRestoreFocusAfterEscape(){if(this.virtualAnchor)return this.returnFocusTo!==void 0;const active=deepActiveElementIn(this.ownerDocument);return safelyComposedContains(this,active)}get requiresOverlayManager(){return this.open}showAt(rect,options){const normalizedRect=normalizeVirtualRect(rect);if(!normalizedRect)return;const previousAnchor=this.virtualAnchor,previousReturnFocusTo=this.returnFocusTo;if(this.virtualAnchor=virtualAnchorFromRect(normalizedRect),this.returnFocusTo=options?.returnFocusTo,this.syncInteractionTrigger(),this.open){this.activateTooltipOverlay(),this.position();return}this.show(),!this.open&&(this.virtualAnchor=previousAnchor,this.returnFocusTo=previousReturnFocusTo,this.syncInteractionTrigger())}show(){return this.cancelPendingTransition(),this.disabled||this._open?Promise.resolve():this.transitionGate.request(!0,()=>{if(this.emit("lr-show",null,{cancelable:!0}).defaultPrevented){this.syncOpenAttribute();return}return this.cancelTransitionAnimation(),this.removeAttribute("data-closing"),this.applyOpenState(!0),this.settleTransition("lr-after-show")})}hide(options){return this.cancelPendingTransition(),this._open?this.transitionGate.request(!1,()=>{if(this.emit("lr-hide",null,{cancelable:!0}).defaultPrevented){this.syncOpenAttribute();return}return options?.restoreFocus&&(this.restoreFocusOnClose=!0),this.cancelTransitionAnimation(),this.isConnected&&this.setAttribute("data-closing",""),this.applyOpenState(!1),this.settleTransition("lr-after-hide")}):Promise.resolve()}forceClose(){return this.cancelPendingTransition(),this._open?(this.cancelTransitionAnimation(),this.isConnected&&this.setAttribute("data-closing",""),this.applyOpenState(!1),this.settleTransition("lr-after-hide")):Promise.resolve()}applyOpenState(next){const old=this._open;this._open=next,next||(this.cancelShadowContentScan(),this.placementPending=!1),next||(this.openedByPointer=!1),this.requestUpdate("open",old)}syncOpenAttribute(){this.toggleAttribute("open",this._open)}cancelTransitionAnimation(){this.transitionAnimation?.cancel(),this.transitionAnimation=void 0}async settleTransition(event){const token=++this.transitionToken;if(await this.updateComplete,this.transitionToken===token){if(event==="lr-after-show"){const positioned=await waitForDeferredPlacement(()=>this.cleanup);if(this.transitionToken!==token||!this.open)return;if(!positioned){await this.forceClose();return}if(await this.updateComplete,this.transitionToken!==token)return}if(this.isConnected){const popup=this.renderRoot.querySelector('[part~="popup"]'),showing=event==="lr-after-show",animation=popup?animateRegistered(this,popup,`tooltip.${showing?"show":"hide"}`,this.effectiveDirection,{keyframes:showing?[{opacity:0},{opacity:1}]:[{opacity:1},{opacity:0}],durationProperties:["--lr-transition-fast","--lr-duration-fast"],easingProperties:["--lr-easing-standard"]}):void 0;if(this.transitionAnimation=animation,await animation?.finished.catch(()=>{}),this.transitionToken!==token)return;this.cancelTransitionAnimation()}event==="lr-after-hide"&&(this.removeAttribute("data-closing"),this.popupHidden=!0,await this.updateComplete,this.transitionToken!==token)||this.emit(event)}}resolveAnchor(){return resolveOverlayAnchor(this,{virtualAnchor:this.virtualAnchor,anchor:this.anchor,for:this.for,trigger:this.triggerElement})}position(){this.cleanup?.(),this.cleanup=void 0;const popup=this.renderRoot.querySelector('[part~="popup"]'),arrowElement=this.renderRoot.querySelector('[part~="arrow"]'),anchor=this.resolveAnchor();if(!this.open||!anchor||!popup){this.positionedAnchor=void 0,this.anchorPositioned=!1,this.placementPending=!1;return}if(anchor!==this.positionedAnchor&&(this.anchorPositioned=!1),this.open&&anchor&&popup){const arrowPadding=Math.max(0,finiteNumber(this.arrowPadding,0));this.placementPending=!0,this.placedTopLayer=syncTopLayerRelease(popup,this.placedTopLayer,this.topLayer),this.cleanup=place(anchor,popup,{placement:rtlAwarePlacement(this.placement,this),...topLayerPlacement(this.topLayer,resolveEffectivePositioningStrategy(this,this._positioningStrategy,"absolute")),offset:finiteNumber(this.distance,DEFAULT_DISTANCE),skidding:finiteNumber(this.skidding,0),arrow:this.rendersArrow&&arrowElement?arrowElement:void 0,arrowPadding,onPlaced:({placement,arrow})=>{this.placementPending=!1,this.positionedAnchor=anchor,this.anchorPositioned=!0;const side=applyOverlayArrow(arrowElement,{placement,coords:arrow,enabled:this.rendersArrow,arrowPlacement:this.arrowPlacement,arrowPadding,rtl:this.effectiveDirection==="rtl",sizeProperty:"--arrow-size",fallbackSizeProperty:"--lr-tooltip-arrow-size"});side!==this.resolvedSide&&(this.resolvedSide=side)}})}}syncTriggerA11y(){const trigger=this.triggerElement??null,proxy=this.open||this.focusDescribesTrigger?this.descriptionProxy:void 0,contribution={descriptions:proxy?[proxy]:[]};this.triggerAria?this.triggerAria.update(trigger,contribution):this.triggerAria=acquireAriaOwnership(trigger,contribution);const accessibleTrigger=this.accessibleTrigger,distinctAccessibleTrigger=accessibleTrigger!==trigger?accessibleTrigger:null;this.accessibleTriggerAria?this.accessibleTriggerAria.update(distinctAccessibleTrigger,contribution):this.accessibleTriggerAria=acquireAriaOwnership(distinctAccessibleTrigger,contribution),this.overlayHandle?.isActive()&&!this.virtualAnchor&&this.overlayHandle.updateRestoreFocusTo(accessibleTrigger)}get accessibleTrigger(){return this.triggerElement?resolveAccessibleTrigger(this.triggerElement):null}releaseTriggerA11y(){this.accessibleTriggerAria?.release(),this.accessibleTriggerAria=void 0,this.triggerAria?.release(),this.triggerAria=void 0}requestTransition(next){if(this.cancelPendingTransition(),this.disabled)return;const delay=this.interactionDelay(next);if(delay<=0){next?this.show():this.hide();return}this.pendingDirection=next?"show":"hide";const view=this.ownerDocument.defaultView;if(!view){this.pendingDirection=void 0;return}this.timerView=view;const timer=view.setTimeout(()=>{this.timerView!==view||this.timer!==timer||(this.timer=void 0,this.timerView=void 0,this.pendingDirection=void 0,next?this.show():this.hide())},delay);this.timer=timer}interactionDelay(showing){const value=showing?this.showDelay:this.hideDelay,fallback=showing?DEFAULT_SHOW_DELAY:DEFAULT_HIDE_DELAY,attribute=showing?"show-delay":"hide-delay";if(this.hasAttribute(attribute)||value!==fallback)return finiteDuration(value,fallback);const property2=showing?"--show-delay":"--hide-delay",match=(this.ownerDocument.defaultView?.getComputedStyle(this).getPropertyValue(property2).trim()??"").match(/^(-?(?:\d+\.?\d*|\.\d+))(ms|s)$/i);if(!match)return fallback;const amount=Number(match[1]),milliseconds=match[2]?.toLowerCase()==="s"?amount*1e3:amount;return finiteDuration(milliseconds,fallback)}cancelPendingTransition(){this.timer!==void 0&&this.timerView?.clearTimeout(this.timer),this.timer=void 0,this.timerView=void 0,this.pendingDirection=void 0}bindTrigger(trigger){trigger.addEventListener("mouseenter",this.onEnter),trigger.addEventListener("mouseleave",this.onLeave),trigger.addEventListener("focusin",this.onEnter),trigger.addEventListener("focusout",this.onLeave),trigger.addEventListener("click",this.onTriggerClick),trigger.addEventListener("keydown",this.onTriggerKeyDown)}unbindTrigger(trigger){trigger.removeEventListener("mouseenter",this.onEnter),trigger.removeEventListener("mouseleave",this.onLeave),trigger.removeEventListener("focusin",this.onEnter),trigger.removeEventListener("focusout",this.onLeave),trigger.removeEventListener("click",this.onTriggerClick),trigger.removeEventListener("keydown",this.onTriggerKeyDown),this.focusDescribesTrigger=!1}isTriggerHeld(trigger){try{if(trigger.matches(":hover"))return!0}catch{}const active=deepActiveElementIn(trigger.ownerDocument);return safelyComposedContains(trigger,active)}adoptTrigger(next){if(next===this.triggerElement){this.syncTriggerA11y();return}const hadTrigger=this.triggerElement!==void 0;if(this.cancelPendingTransition(),this.triggerElement&&this.unbindTrigger(this.triggerElement),this.triggerElement=next,!this.triggerElement){this.syncTriggerA11y(),hadTrigger&&this.open&&!this.resolveAnchor()&&this.forceClose();return}this.bindTrigger(this.triggerElement),this.syncTriggerA11y(),hadTrigger&&this._open&&this.openedByPointer&&!this.isTriggerHeld(this.triggerElement)&&this.forceClose(),this.open&&this.position(),this.open&&this.interactiveContent&&this.activateTooltipOverlay()}isPopupTarget(target){if(target===null||target.nodeType!==1)return!1;const element=target,slot=this.activeContentSlot;return this.renderRoot.querySelector('[part~="popup"]')?.contains(element)===!0||slot?.assignedElements({flatten:!0}).some(root=>composedContains(root,element))===!0}clearContentSlotListeners(){for(const slot of this.contentSlotListeners)slot.removeEventListener("slotchange",this.onContentSlotChange);this.contentSlotListeners.clear()}syncContentSlotListeners(slots){const activeSlot=this.activeContentSlot;for(const slot of this.contentSlotListeners)slots.has(slot)&&slot!==activeSlot||(slot.removeEventListener("slotchange",this.onContentSlotChange),this.contentSlotListeners.delete(slot));for(const slot of slots)slot===activeSlot||this.contentSlotListeners.has(slot)||(slot.addEventListener("slotchange",this.onContentSlotChange),this.contentSlotListeners.add(slot))}inspectContent(){const snapshot={actionable:!1,assigned:!1,awaitingShadowRoot:!1,labelReferenceRoots:new Set,text:"",externalRoots:new Set,shadowRoots:new Set,forwardingSlots:new Set,composedAncestors:new Set},activeSlot=this.activeContentSlot;if(!activeSlot)return snapshot;const renderRoot=this.renderRoot??this.shadowRoot;snapshot.assigned=activeSlot.assignedNodes().length>0;const popup=renderRoot?.querySelector('[part~="popup"]'),bypassClosedVisibility=popup?.hasAttribute("data-hidden")===!0||this.placementPending,previousVisibility=popup?.style.getPropertyValue("visibility")??"",previousVisibilityPriority=popup?.style.getPropertyPriority("visibility")??"",previousHidden=popup?.hidden??!1;if(popup&&bypassClosedVisibility){const hostVisibility=this.ownerDocument.defaultView?.getComputedStyle(this).visibility??"visible";popup.style.setProperty("visibility",hostVisibility),popup.hidden=!1}try{const visitedContentElements=new Set,elementStates=new Map,accessibilityText=composedAccessibilityTextResult(activeSlot,{shouldPruneNode:node=>{if(node.getRootNode()!==renderRoot&&!this.contains(node)&&snapshot.externalRoots.add(node),node.nodeType!==1)return!1;const element=node;return visitedContentElements.add(element),element.localName==="slot"&&snapshot.forwardingSlots.add(element),element.shadowRoot?snapshot.shadowRoots.add(element.shadowRoot):element.localName.includes("-")&&(snapshot.awaitingShadowRoot=!0),!1},onElementState:(element,state2)=>elementStates.set(element,state2)});for(const element of elementStates.keys())!visitedContentElements.has(element)&&element!==this&&snapshot.composedAncestors.add(element);for(const element of visitedContentElements){if(!isActionableElement(element))continue;const state2=element.localName==="map"||element.localName==="area"?void 0:elementStates.get(element);if(state2?.subtreeExcluded??isAccessibilitySubtreeExcluded(element))continue;(state2?.visibilityHidden??isAccessibilityVisibilityHidden(element))||(snapshot.actionable=!0)}snapshot.text=accessibilityText.text.replace(/\s+/g," ").trim();for(const root of accessibilityText.labelReferenceRoots)snapshot.labelReferenceRoots.add(root);for(const reference of accessibilityText.referencedElements)snapshot.externalRoots.add(reference)}finally{popup&&bypassClosedVisibility&&(previousVisibility?popup.style.setProperty("visibility",previousVisibility,previousVisibilityPriority):popup.style.removeProperty("visibility"),popup.hidden=previousHidden)}return snapshot}observeContentNode(node){if(this.contentObserver){if(node.nodeType===3){this.contentObserver.observe(node,{characterData:!0});return}node.nodeType!==1&&node.nodeType!==11||this.contentObserver.observe(node,{attributes:!0,attributeFilter:["aria-hidden","aria-label","aria-labelledby","alt","class","contenteditable","hidden","href","inert","open","role","slot","style","tabindex"],childList:!0,characterData:!0,subtree:!0})}}bindContentObservation(snapshot){if(this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.isConnected&&snapshot.labelReferenceRoots.size>0){const cleanups=[...snapshot.labelReferenceRoots].map(root=>observeOverlayAnchorIdentity(root,()=>this.updateInteractiveContent()));this.stopLabelReferenceIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}if(!this.contentObserver)return;const pendingRecords=this.contentObserver.takeRecords();this.contentObserver.disconnect(),pendingRecords.length>0&&queueMicrotask(()=>this.updateInteractiveContent());const ancestorFilter={attributes:!0,attributeFilter:["aria-hidden","class","hidden","inert","style"]};for(const ancestor of snapshot.composedAncestors)ancestor===this||ancestor.getRootNode()===this.renderRoot||snapshot.externalRoots.has(ancestor)||this.contentObserver.observe(ancestor,ancestorFilter);for(let ancestor=composedParentElement(this),hops=0;ancestor&&hops<64;ancestor=composedParentElement(ancestor),hops++)this.contentObserver.observe(ancestor,ancestorFilter);this.observeContentNode(this);for(const root of snapshot.externalRoots)this.observeContentNode(root);for(const root of snapshot.shadowRoots)this.observeContentNode(root)}updateInteractiveContent(fromShadowContentScan=!1){fromShadowContentScan||(this.shadowContentScanAttempts=0);const snapshot=this.inspectContent();this.interactiveContent=snapshot.actionable,this.syncContentSlotListeners(snapshot.forwardingSlots),this.bindContentObservation(snapshot),this.scheduleShadowContentScan(snapshot.awaitingShadowRoot),this.updateDescriptionProxy(snapshot.text,snapshot.assigned)}scheduleShadowContentScan(awaitingShadowRoot){if(this.cancelShadowContentScan(!1),!awaitingShadowRoot||!this.open||!this.isConnected||this.shadowContentScanAttempts>=MAX_SHADOW_CONTENT_SCAN_FRAMES)return;const view=this.ownerDocument.defaultView;view&&(this.shadowContentScanView=view,this.shadowContentScanFrame=view.requestAnimationFrame(()=>{this.shadowContentScanFrame=void 0,this.shadowContentScanView=void 0,this.shadowContentScanAttempts++,this.updateInteractiveContent(!0)}))}cancelShadowContentScan(resetAttempts=!0){this.shadowContentScanFrame!==void 0&&this.shadowContentScanView?.cancelAnimationFrame(this.shadowContentScanFrame),this.shadowContentScanFrame=void 0,this.shadowContentScanView=void 0,resetAttempts&&(this.shadowContentScanAttempts=0)}ensureDescriptionProxy(){this.descriptionProxy||(this.descriptionProxy=this.ownerDocument.createElement("span"),this.descriptionProxy.id=this.descriptionId,this.descriptionProxy.slot="__lr-tooltip-description",this.descriptionProxy.hidden=!0,this.descriptionProxy.dataset.lyraTooltipDescription=""),this.descriptionProxy.parentElement!==this&&this.append(this.descriptionProxy),this.updateDescriptionProxy()}updateDescriptionProxy(contentText,assigned){if(!this.descriptionProxy)return;const hostLabel=this.getAttribute("aria-label"),snapshot=contentText===void 0||assigned===void 0?this.inspectContent():void 0,visibleContent=contentText??snapshot?.text??"",hasAssignment=assigned??snapshot?.assigned??!1,description=hostLabel!==null?hostLabel.trim():(this.accessibleLabel||visibleContent||(hasAssignment?"":this.content)).trim();this.descriptionProxy.textContent!==description&&(this.descriptionProxy.textContent=description)}render(){const hostLabel=this.getAttribute("aria-label"),propertyLabel=this.accessibleLabel??"",hasExplicitLabel=hostLabel!==null||propertyLabel.length>0,label=hostLabel!==null?hostLabel:propertyLabel,popupLabel=this.interactiveContent?hasExplicitLabel?label:this.localize("popover"):hasExplicitLabel?label:nothing;return html`
2
2
  <span part="trigger">
3
3
  ${this.namedTriggerMode?html`<slot name="trigger" @slotchange=${this.onTriggerSlotChange}></slot>`:html`<slot @slotchange=${this.onTriggerSlotChange}></slot>`}
4
4
  </span>
@@ -11,6 +11,8 @@ maxNodes?:number;
11
11
  shouldPrune?:(element:Element)=>boolean;
12
12
  /** Additional pruning that can also reject externally assigned Text nodes. */
13
13
  shouldPruneNode?:(node:Node)=>boolean;
14
+ /** Observes each element/ancestor visibility snapshot read by this walk. Does not change traversal. */
15
+ onElementState?:(element:Element,state:Readonly<AccessibilityElementState>)=>void;
14
16
  /** Replaces the ordinary own-subtree exclusion predicate for presentation-owned fences. */
15
17
  isSubtreeExcluded?:(element:Element)=>boolean;
16
18
  /** Stops initial composed-ancestor validation after this boundary is validated. */
@@ -31,7 +33,7 @@ skipRootAncestorValidation?:boolean;
31
33
  * `display: none` still prune exactly as before. */
32
34
  ignoreInheritedVisibility?:boolean;}export interface ComposedAccessibilityTextResult{labelReferenceRoots:ReadonlySet<Document|ShadowRoot>;referencedElements:ReadonlySet<Element>;text:string;
33
35
  /** Open roots actually entered by the bounded walk, suitable for live-text observation. */
34
- traversedShadowRoots:ReadonlySet<ShadowRoot>;truncated:boolean;truncationReasons:readonly AccessibilityTextTruncationReason[];visitedNodes:number;}
36
+ traversedShadowRoots:ReadonlySet<ShadowRoot>;truncated:boolean;truncationReasons:readonly AccessibilityTextTruncationReason[];visitedNodes:number;}export interface AccessibilityElementState{display:string|undefined;subtreeExcluded:boolean;visibilityHidden:boolean;}
35
37
  /** `aria-hidden` is an ASCII case-insensitive true/false token in HTML. */
36
38
  export declare function isAriaTrue(value:string|null):boolean;
37
39
  /**
@@ -1 +1 @@
1
- import{composedParentElement}from"./active-element.js";import{asciiWhitespaceTokens}from"./ascii-whitespace.js";import{imageMapImageFor}from"./dom-guards.js";import{composedParentElement as composedParentElement2}from"./active-element.js";const NON_CONTENT_ELEMENTS=new Set(["script","style","template"]),DEFAULT_ACCESSIBILITY_TEXT_MAX_CHARACTERS=4096,DEFAULT_ACCESSIBILITY_TEXT_MAX_DEPTH=256,DEFAULT_ACCESSIBILITY_TEXT_MAX_NODES=4096,DEFAULT_ACCESSIBILITY_VISIBILITY_MAX_NODES=512,MAX_CONFIGURED_ACCESSIBILITY_TEXT_LIMIT=1e5;function isAriaTrue(value){return value?.trim().toLowerCase()==="true"}function accessibilityElementState(element,imageMapImage=imageMapImageFor(element)){let rendered;try{rendered=element.ownerDocument.defaultView?.getComputedStyle(element)}catch{}const visibility=rendered?.visibility;return{display:rendered?.display,subtreeExcluded:element.hasAttribute("hidden")||element.hasAttribute("inert")||isAriaTrue(element.getAttribute("aria-hidden"))||!imageMapImage&&(rendered?.display==="none"||rendered?.contentVisibility==="hidden"),visibilityHidden:visibility==="hidden"||visibility==="collapse"}}function isAccessibilitySubtreeExcluded(element){return accessibilityElementState(element).subtreeExcluded}function isAccessibilityVisibilityHidden(element){return accessibilityElementState(element).visibilityHidden}function isAccessibilityExcluded(element){return isAccessibilitySubtreeExcluded(element)||isAccessibilityVisibilityHidden(element)}const CONTENT_NODE_ATTRIBUTES=["alt","aria-hidden","aria-label","aria-labelledby","class","hidden","id","inert","open","style"],ANCESTOR_ATTRIBUTES=["aria-hidden","class","hidden","inert","open","style"];function observeAccessibleTextNode(observer,node,extraAttributes){if(node.nodeType===3){observer.observe(node,{characterData:!0});return}node.nodeType!==1&&node.nodeType!==11||observer.observe(node,{attributes:!0,attributeFilter:[...new Set([...CONTENT_NODE_ATTRIBUTES,...extraAttributes])],childList:!0,characterData:!0,subtree:!0})}function bindAccessibleTextObserver(observer,host,extraAttributes=[],upgrades){if(!observer)return;observer.disconnect(),observeAccessibleTextNode(observer,host,extraAttributes);let ancestor=composedParentElement(host);for(;ancestor;)observer.observe(ancestor,{attributes:!0,attributeFilter:ANCESTOR_ATTRIBUTES}),ancestor=composedParentElement(ancestor);for(const slot of host.querySelectorAll("slot"))for(const assigned of slot.assignedNodes({flatten:!0}))observeAccessibleTextNode(observer,assigned,extraAttributes);const result=composedAccessibilityTextResult(host.childNodes,{requireRendered:!1,shouldPrune:element=>(upgrades?.observeElement(element),!1)});for(const root of result.traversedShadowRoots)root!==host.shadowRoot&&observeAccessibleTextNode(observer,root,extraAttributes)}function finiteTextLimit(value,fallback){return Number.isFinite(value)?Math.min(MAX_CONFIGURED_ACCESSIBILITY_TEXT_LIMIT,Math.max(0,Math.floor(value))):fallback}function isNodeValue(value){if(typeof value!="object"&&typeof value!="function"||value===null)return!1;try{return typeof value.nodeType=="number"&&typeof value.getRootNode=="function"}catch{return!1}}function consumeNodeWork(context){return context.workUnits>=context.maxNodes?(context.reasons.add("nodes"),!1):(context.workUnits+=1,!0)}function cachedElementState(context,element){let state=context.elementStates.get(element);return state||(state=accessibilityElementState(element,cachedImageMapImage(context,element)),context.elementStates.set(element,state)),state}function cachedImageMapImage(context,element){if(context.imageMapImages.has(element))return context.imageMapImages.get(element);const image=imageMapImageFor(element,{consume:()=>consumeNodeWork(context)});return context.imageMapImages.set(element,image),image}function cachedSubtreeExcluded(context,element){if(context.excludedElements.has(element))return context.excludedElements.get(element);const excluded=context.isSubtreeExcluded?context.isSubtreeExcluded(element):cachedElementState(context,element).subtreeExcluded;return context.excludedElements.set(element,excluded),excluded}function addLabelReferenceRoot(context,node){const root=node.getRootNode();(root.nodeType===9||root.nodeType===11&&"host"in root)&&context.labelReferenceRoots.add(root)}function appendBoundedText(context,value){if(value==="")return;if(context.outputLength>=context.maxCharacters){context.reasons.add("characters"),context.stack.length=0;return}const remaining=context.maxCharacters-context.outputLength;if(value.length>remaining){context.output.push(value.slice(0,remaining)),context.outputLength+=remaining,context.reasons.add("characters"),context.stack.length=0;return}context.output.push(value),context.outputLength+=value.length}function composedAncestorState(context,node){const slottable=node;let branch=node.nodeType===1?node:slottable.assignedSlot??node.parentElement,ancestor=node.nodeType===1?composedParentElement(node):slottable.assignedSlot??node.parentElement,depth=0,inheritedTextVisible=!0,firstAncestor=!0;for(;ancestor;){if(!consumeNodeWork(context))return{available:!1,inheritedTextVisible};const state=cachedElementState(context,ancestor);if(firstAncestor&&(inheritedTextVisible=!state.visibilityHidden,firstAncestor=!1),cachedSubtreeExcluded(context,ancestor)||isClosedDetailsContentBranchBounded(context,ancestor,branch))return{available:!1,inheritedTextVisible};if(ancestor===context.ancestorBoundary)return{available:!0,inheritedTextVisible};if(depth+=1,depth>context.maxDepth)return context.reasons.add("ancestors"),{available:!1,inheritedTextVisible};branch=ancestor,ancestor=composedParentElement(ancestor)}return{available:!0,inheritedTextVisible}}function inheritedVisibilityHidden(context,node){const slottable=node,ancestor=node.nodeType===1?composedParentElement(node):slottable.assignedSlot??node.parentElement;return ancestor?cachedElementState(context,ancestor).visibilityHidden:!1}function scheduleNode(context,node,depth,inheritedTextVisible,referenced,available,workCharged=!1){return depth>context.maxDepth?(context.reasons.add("depth"),!1):(context.stack.push({available,depth,inheritedTextVisible,kind:"node",node,referenced,workCharged}),!0)}function scheduleNodeList(context,nodes,depth,inheritedTextVisible,referenced,available){if(nodes.length!==0){if(depth>context.maxDepth){context.reasons.add("depth");return}context.stack.push({available,depth,index:0,inheritedTextVisible,kind:"nodes",nodes,referenced})}}function scheduleRenderedChildNodes(context,element,depth,inheritedTextVisible,referenced,available){if(element.localName==="slot"){const slot=element,root=slot.getRootNode(),candidates=root.nodeType===11&&"host"in root?root.host.childNodes:[];if(depth>context.maxDepth){(candidates.length>0||slot.childNodes.length>0)&&context.reasons.add("depth");return}context.stack.push({available,candidates,depth,fallback:slot.childNodes,foundAssigned:!1,index:0,inheritedTextVisible,kind:"slot",referenced,slot});return}if(element.localName==="details"&&!element.hasAttribute("open")){for(const child of element.children){if(!consumeNodeWork(context))return;if(child.localName==="summary"){scheduleNode(context,child,depth,inheritedTextVisible,referenced,available,!0);return}}return}const shadowRoot=element.shadowRoot,childNodes=shadowRoot?.childNodes??element.childNodes;shadowRoot&&(childNodes.length===0||depth<=context.maxDepth)&&context.traversedShadowRoots.add(shadowRoot),scheduleNodeList(context,childNodes,depth,inheritedTextVisible,referenced,available)}function labelledByElements(context,element){const value=element.getAttribute("aria-labelledby");if(value===null)return{authoritative:!1,elements:[]};addLabelReferenceRoot(context,element);const root=element.getRootNode(),canResolveSerialized=typeof root.getElementById=="function",serializedReferences=[];let sawSerializedToken=!1;for(const id of asciiWhitespaceTokens(value,()=>consumeNodeWork(context))){if(sawSerializedToken=!0,!consumeNodeWork(context))return{authoritative:!0,elements:serializedReferences};const reference=canResolveSerialized?root.getElementById(id):null;reference&&serializedReferences.push(reference)}if(sawSerializedToken)return{authoritative:serializedReferences.length>0,elements:serializedReferences};if(context.workUnits>=context.maxNodes||!consumeNodeWork(context))return context.reasons.add("nodes"),{authoritative:!0,elements:[]};if(context.workUnits>=context.maxNodes)return context.reasons.add("nodes"),{authoritative:!0,elements:[]};try{const ElementConstructor=element.ownerDocument.defaultView?.Element,descriptor=ElementConstructor?Object.getOwnPropertyDescriptor(ElementConstructor.prototype,"ariaLabelledByElements"):void 0,reflected=typeof descriptor?.get=="function"?descriptor.get.call(element):void 0;if(reflected?.length){const result=[];for(let index=0;index<reflected.length&&consumeNodeWork(context);index+=1){const reference=reflected[index];!reference||reference.nodeType!==1||(result.push(reference),addLabelReferenceRoot(context,reference))}return{authoritative:!0,elements:result}}}catch{}return{authoritative:!1,elements:[]}}const OWNED_CLOSED_POPUP_SELECTOR='[part~="popup"], .submenu-surface';function hasOwnedClosedPopupAncestor(node){let current=composedParentElement(node);for(;current;){if(current.hidden&&current.matches(OWNED_CLOSED_POPUP_SELECTOR))return!0;current=composedParentElement(current)}return!1}function isAncestorBoundaryExternallyUnrendered(context){if(context.externallyUnrenderedBoundary!==void 0)return context.externallyUnrenderedBoundary;const boundary=context.ancestorBoundary;let result=!1;if(boundary&&!cachedSubtreeExcluded(context,boundary)){const candidate=boundary;if(typeof candidate.checkVisibility=="function")try{result=!candidate.checkVisibility({contentVisibilityAuto:!0})&&hasOwnedClosedPopupAncestor(boundary)}catch{result=!1}}return context.externallyUnrenderedBoundary=result,result}function isRenderedAccessibilityBranch(context,element,display){const imageMapImage=cachedImageMapImage(context,element);if(imageMapImage)return isRenderedAccessibilityBranch(context,imageMapImage,cachedElementState(context,imageMapImage).display);if(!element.isConnected||display==="contents")return!0;const candidate=element;if(typeof candidate.checkVisibility!="function")return!0;try{return candidate.checkVisibility({contentVisibilityAuto:!0})?!0:context.ignoreInheritedVisibility&&isAncestorBoundaryExternallyUnrendered(context)}catch{return!1}}function processAccessibilityTextWork(context){for(;context.stack.length>0;){const work=context.stack.pop();if(work.kind==="text"){appendBoundedText(context,work.value);continue}if(work.kind==="slot"){if(work.index>=work.candidates.length){work.foundAssigned||scheduleNodeList(context,work.fallback,work.depth,work.inheritedTextVisible,work.referenced,work.available);continue}if(!consumeNodeWork(context)){context.stack.length=0;break}const node=work.candidates[work.index],assigned=!!(node&&node.assignedSlot===work.slot);context.stack.push({...work,foundAssigned:work.foundAssigned||assigned,index:work.index+1}),node&&assigned&&(scheduleNode(context,node,work.depth,work.inheritedTextVisible,work.referenced,work.available,!0),work.foundAssigned&&context.stack.push({kind:"text",value:" "}));continue}if(work.kind==="nodes"){if(work.index>=work.nodes.length)continue;const node=work.nodes[work.index];if(!node)continue;context.stack.push({...work,index:work.index+1}),scheduleNode(context,node,work.depth,work.inheritedTextVisible,work.referenced,work.available),work.index>0&&context.stack.push({kind:"text",value:" "});continue}if(context.visited.has(work.node))continue;if(!work.workCharged&&!consumeNodeWork(context)){context.stack.length=0;break}if(context.visited.add(work.node),context.visitedNodes+=1,!work.referenced&&context.shouldPruneNode?.(work.node))continue;if(work.node.nodeType===3){(work.referenced||work.available&&work.inheritedTextVisible)&&appendBoundedText(context,work.node.textContent??"");continue}if(work.node.nodeType===11){"host"in work.node&&context.traversedShadowRoots.add(work.node),scheduleNodeList(context,work.node.childNodes,work.depth+1,work.inheritedTextVisible,work.referenced,work.available);continue}if(work.node.nodeType!==1)continue;const element=work.node;if(NON_CONTENT_ELEMENTS.has(element.localName)||context.shouldPrune?.(element))continue;const state=cachedElementState(context,element),excluded=cachedSubtreeExcluded(context,element),available=work.referenced||work.available&&!excluded;if(!available||!work.referenced&&context.requireRendered&&!isRenderedAccessibilityBranch(context,element,state.display))continue;const ownTextVisible=work.referenced||!state.visibilityHidden||context.visibilityBaselineHidden,labelledBy=ownTextVisible?labelledByElements(context,element):{authoritative:!1,elements:[]};if(labelledBy.elements.length>0){for(const reference of labelledBy.elements)context.referencedElements.add(reference);scheduleNodeList(context,labelledBy.elements,work.depth+1,!0,!0,!0);continue}if(labelledBy.authoritative)continue;const ariaLabel=ownTextVisible?element.getAttribute("aria-label"):null;if(ariaLabel?.trim()){appendBoundedText(context,ariaLabel.trim());continue}if(ownTextVisible&&(element.localName==="img"||element.localName==="area")){const alt=element.getAttribute("alt");if(alt?.trim()){appendBoundedText(context,alt.trim());continue}}scheduleRenderedChildNodes(context,element,work.depth+1,ownTextVisible,work.referenced,available)}}function normalizedTextOptions(options){const resolved=typeof options=="boolean"?{inheritedTextVisible:options}:options??{};return{...resolved,inheritedTextVisible:resolved.inheritedTextVisible??!0,maxCharacters:finiteTextLimit(resolved.maxCharacters,DEFAULT_ACCESSIBILITY_TEXT_MAX_CHARACTERS),maxDepth:finiteTextLimit(resolved.maxDepth,DEFAULT_ACCESSIBILITY_TEXT_MAX_DEPTH),maxNodes:finiteTextLimit(resolved.maxNodes,DEFAULT_ACCESSIBILITY_TEXT_MAX_NODES)}}function composedAccessibilityTextResult(input,options){const resolved=normalizedTextOptions(options),context={ancestorBoundary:resolved.ancestorBoundary??null,elementStates:new Map,excludedElements:new Map,imageMapImages:new Map,isSubtreeExcluded:resolved.isSubtreeExcluded,ignoreInheritedVisibility:resolved.skipRootAncestorValidation===!0||resolved.ignoreInheritedVisibility===!0,labelReferenceRoots:new Set,maxCharacters:resolved.maxCharacters,maxDepth:resolved.maxDepth,maxNodes:resolved.maxNodes,output:[],outputLength:0,reasons:new Set,referencedElements:new Set,requireRendered:resolved.requireRendered!==!1,shouldPrune:resolved.shouldPrune,shouldPruneNode:resolved.shouldPruneNode,stack:[],traversedShadowRoots:new Set,visibilityBaselineHidden:!1,visited:new Set,visitedNodes:0,workUnits:0};if(context.maxNodes===0)return context.reasons.add("nodes"),{labelReferenceRoots:context.labelReferenceRoots,referencedElements:context.referencedElements,text:"",traversedShadowRoots:context.traversedShadowRoots,truncated:!0,truncationReasons:[...context.reasons],visitedNodes:0};const roots=isNodeValue(input)?[input]:input;let rootCount=0;for(const root of roots){if(!isNodeValue(root))continue;if(context.workUnits>=context.maxNodes){context.reasons.add("nodes");break}if(rootCount>0&&appendBoundedText(context," "),context.reasons.has("characters"))break;const validated=resolved.skipRootAncestorValidation?{available:!0,inheritedTextVisible:!0}:composedAncestorState(context,root);context.visibilityBaselineHidden=(root.nodeType===1||!resolved.skipRootAncestorValidation)&&context.ignoreInheritedVisibility&&inheritedVisibilityHidden(context,root);const ancestorState=context.visibilityBaselineHidden?{available:validated.available,inheritedTextVisible:!0}:validated;if(scheduleNode(context,root,0,resolved.inheritedTextVisible&&ancestorState.inheritedTextVisible,!1,ancestorState.available),processAccessibilityTextWork(context),rootCount+=1,context.reasons.has("characters")||context.reasons.has("nodes")&&context.workUnits>=context.maxNodes)break}return{labelReferenceRoots:context.labelReferenceRoots,referencedElements:context.referencedElements,text:context.output.join(""),traversedShadowRoots:context.traversedShadowRoots,truncated:context.reasons.size>0,truncationReasons:[...context.reasons],visitedNodes:context.visitedNodes}}function composedAccessibilityText(input,options){return composedAccessibilityTextResult(input,options).text}function composedAccessibleVisibleText(node){return composedAccessibilityText(node)}function isClosedDetailsContentBranchWithin(details,branch,consume){if(details.localName!=="details"||details.hasAttribute("open")||branch===null)return!1;let summary=null;for(const child of details.children){if(!consume())return!0;if(child.localName==="summary"){summary=child;break}}return branch!==summary}function isClosedDetailsContentBranchBounded(context,details,branch){if(details.localName!=="details"||details.hasAttribute("open")||branch===null)return!1;for(const child of details.children){if(!consumeNodeWork(context))return!0;if(child.localName==="summary")return child!==branch}return!0}function isAccessibilityVisible(element,options={}){if(!element.isConnected)return!1;const maxDepth=finiteTextLimit(options.maxDepth,DEFAULT_ACCESSIBILITY_TEXT_MAX_DEPTH),maxNodes=finiteTextLimit(options.maxNodes,DEFAULT_ACCESSIBILITY_VISIBILITY_MAX_NODES);let workUnits=0;const consume=()=>workUnits>=maxNodes?!1:(workUnits+=1,!0);let current=element,composedChild=null,depth=0,targetState,renderedSource=element;for(;current;){if(depth>maxDepth||!consume())return!1;const imageMapImage=imageMapImageFor(current,{consume}),state=accessibilityElementState(current,imageMapImage);if(current===element&&(targetState=state,renderedSource=imageMapImage??element),!options.ignorePresentation?.(current)&&(state.subtreeExcluded||isClosedDetailsContentBranchWithin(current,composedChild,consume)||current===element&&state.visibilityHidden))return!1;composedChild=current,current=composedParentElement(current),depth+=1}if(renderedSource!==element)for(current=renderedSource,composedChild=null,depth=0;current;){if(depth>maxDepth||!consume())return!1;const state=accessibilityElementState(current,imageMapImageFor(current,{consume}));if(current===renderedSource&&(targetState=state),!options.ignorePresentation?.(current)&&(state.subtreeExcluded||isClosedDetailsContentBranchWithin(current,composedChild,consume)||current===renderedSource&&state.visibilityHidden))return!1;composedChild=current,current=composedParentElement(current),depth+=1}if(targetState?.display==="contents")return!0;const visibilityTarget=renderedSource;if(!consume())return!1;try{return typeof visibilityTarget.checkVisibility=="function"?visibilityTarget.checkVisibility({contentVisibilityAuto:!0}):!0}catch{return!1}}export{bindAccessibleTextObserver,composedAccessibilityText,composedAccessibilityTextResult,composedAccessibleVisibleText,composedParentElement2 as composedParentElement,isAccessibilityExcluded,isAccessibilitySubtreeExcluded,isAccessibilityVisibilityHidden,isAccessibilityVisible,isAriaTrue};
1
+ import{composedParentElement}from"./active-element.js";import{asciiWhitespaceTokens}from"./ascii-whitespace.js";import{imageMapImageFor}from"./dom-guards.js";import{composedParentElement as composedParentElement2}from"./active-element.js";const NON_CONTENT_ELEMENTS=new Set(["script","style","template"]),DEFAULT_ACCESSIBILITY_TEXT_MAX_CHARACTERS=4096,DEFAULT_ACCESSIBILITY_TEXT_MAX_DEPTH=256,DEFAULT_ACCESSIBILITY_TEXT_MAX_NODES=4096,DEFAULT_ACCESSIBILITY_VISIBILITY_MAX_NODES=512,MAX_CONFIGURED_ACCESSIBILITY_TEXT_LIMIT=1e5;function isAriaTrue(value){return value?.trim().toLowerCase()==="true"}function accessibilityElementState(element,imageMapImage=imageMapImageFor(element)){let rendered;try{rendered=element.ownerDocument.defaultView?.getComputedStyle(element)}catch{}const visibility=rendered?.visibility;return{display:rendered?.display,subtreeExcluded:element.hasAttribute("hidden")||element.hasAttribute("inert")||isAriaTrue(element.getAttribute("aria-hidden"))||!imageMapImage&&(rendered?.display==="none"||rendered?.contentVisibility==="hidden"),visibilityHidden:visibility==="hidden"||visibility==="collapse"}}function isAccessibilitySubtreeExcluded(element){return accessibilityElementState(element).subtreeExcluded}function isAccessibilityVisibilityHidden(element){return accessibilityElementState(element).visibilityHidden}function isAccessibilityExcluded(element){return isAccessibilitySubtreeExcluded(element)||isAccessibilityVisibilityHidden(element)}const CONTENT_NODE_ATTRIBUTES=["alt","aria-hidden","aria-label","aria-labelledby","class","hidden","id","inert","open","style"],ANCESTOR_ATTRIBUTES=["aria-hidden","class","hidden","inert","open","style"];function observeAccessibleTextNode(observer,node,extraAttributes){if(node.nodeType===3){observer.observe(node,{characterData:!0});return}node.nodeType!==1&&node.nodeType!==11||observer.observe(node,{attributes:!0,attributeFilter:[...new Set([...CONTENT_NODE_ATTRIBUTES,...extraAttributes])],childList:!0,characterData:!0,subtree:!0})}function bindAccessibleTextObserver(observer,host,extraAttributes=[],upgrades){if(!observer)return;observer.disconnect(),observeAccessibleTextNode(observer,host,extraAttributes);let ancestor=composedParentElement(host);for(;ancestor;)observer.observe(ancestor,{attributes:!0,attributeFilter:ANCESTOR_ATTRIBUTES}),ancestor=composedParentElement(ancestor);for(const slot of host.querySelectorAll("slot"))for(const assigned of slot.assignedNodes({flatten:!0}))observeAccessibleTextNode(observer,assigned,extraAttributes);const result=composedAccessibilityTextResult(host.childNodes,{requireRendered:!1,shouldPrune:element=>(upgrades?.observeElement(element),!1)});for(const root of result.traversedShadowRoots)root!==host.shadowRoot&&observeAccessibleTextNode(observer,root,extraAttributes)}function finiteTextLimit(value,fallback){return Number.isFinite(value)?Math.min(MAX_CONFIGURED_ACCESSIBILITY_TEXT_LIMIT,Math.max(0,Math.floor(value))):fallback}function isNodeValue(value){if(typeof value!="object"&&typeof value!="function"||value===null)return!1;try{return typeof value.nodeType=="number"&&typeof value.getRootNode=="function"}catch{return!1}}function consumeNodeWork(context){return context.workUnits>=context.maxNodes?(context.reasons.add("nodes"),!1):(context.workUnits+=1,!0)}function cachedElementState(context,element){let state=context.elementStates.get(element);return state||(state=accessibilityElementState(element,cachedImageMapImage(context,element)),context.elementStates.set(element,state),context.onElementState?.(element,state)),state}function cachedImageMapImage(context,element){if(context.imageMapImages.has(element))return context.imageMapImages.get(element);const image=imageMapImageFor(element,{consume:()=>consumeNodeWork(context)});return context.imageMapImages.set(element,image),image}function cachedSubtreeExcluded(context,element){if(context.excludedElements.has(element))return context.excludedElements.get(element);const excluded=context.isSubtreeExcluded?context.isSubtreeExcluded(element):cachedElementState(context,element).subtreeExcluded;return context.excludedElements.set(element,excluded),excluded}function addLabelReferenceRoot(context,node){const root=node.getRootNode();(root.nodeType===9||root.nodeType===11&&"host"in root)&&context.labelReferenceRoots.add(root)}function appendBoundedText(context,value){if(value==="")return;if(context.outputLength>=context.maxCharacters){context.reasons.add("characters"),context.stack.length=0;return}const remaining=context.maxCharacters-context.outputLength;if(value.length>remaining){context.output.push(value.slice(0,remaining)),context.outputLength+=remaining,context.reasons.add("characters"),context.stack.length=0;return}context.output.push(value),context.outputLength+=value.length}function composedAncestorState(context,node){const slottable=node;let branch=node.nodeType===1?node:slottable.assignedSlot??node.parentElement,ancestor=node.nodeType===1?composedParentElement(node):slottable.assignedSlot??node.parentElement,depth=0,inheritedTextVisible=!0,firstAncestor=!0;for(;ancestor;){if(!consumeNodeWork(context))return{available:!1,inheritedTextVisible};const state=cachedElementState(context,ancestor);if(firstAncestor&&(inheritedTextVisible=!state.visibilityHidden,firstAncestor=!1),cachedSubtreeExcluded(context,ancestor)||isClosedDetailsContentBranchBounded(context,ancestor,branch))return{available:!1,inheritedTextVisible};if(ancestor===context.ancestorBoundary)return{available:!0,inheritedTextVisible};if(depth+=1,depth>context.maxDepth)return context.reasons.add("ancestors"),{available:!1,inheritedTextVisible};branch=ancestor,ancestor=composedParentElement(ancestor)}return{available:!0,inheritedTextVisible}}function inheritedVisibilityHidden(context,node){const slottable=node,ancestor=node.nodeType===1?composedParentElement(node):slottable.assignedSlot??node.parentElement;return ancestor?cachedElementState(context,ancestor).visibilityHidden:!1}function scheduleNode(context,node,depth,inheritedTextVisible,referenced,available,workCharged=!1){return depth>context.maxDepth?(context.reasons.add("depth"),!1):(context.stack.push({available,depth,inheritedTextVisible,kind:"node",node,referenced,workCharged}),!0)}function scheduleNodeList(context,nodes,depth,inheritedTextVisible,referenced,available){if(nodes.length!==0){if(depth>context.maxDepth){context.reasons.add("depth");return}context.stack.push({available,depth,index:0,inheritedTextVisible,kind:"nodes",nodes,referenced})}}function scheduleRenderedChildNodes(context,element,depth,inheritedTextVisible,referenced,available){if(element.localName==="slot"){const slot=element,root=slot.getRootNode(),candidates=root.nodeType===11&&"host"in root?root.host.childNodes:[];if(depth>context.maxDepth){(candidates.length>0||slot.childNodes.length>0)&&context.reasons.add("depth");return}context.stack.push({available,candidates,depth,fallback:slot.childNodes,foundAssigned:!1,index:0,inheritedTextVisible,kind:"slot",referenced,slot});return}if(element.localName==="details"&&!element.hasAttribute("open")){for(const child of element.children){if(!consumeNodeWork(context))return;if(child.localName==="summary"){scheduleNode(context,child,depth,inheritedTextVisible,referenced,available,!0);return}}return}const shadowRoot=element.shadowRoot,childNodes=shadowRoot?.childNodes??element.childNodes;shadowRoot&&(childNodes.length===0||depth<=context.maxDepth)&&context.traversedShadowRoots.add(shadowRoot),scheduleNodeList(context,childNodes,depth,inheritedTextVisible,referenced,available)}function labelledByElements(context,element){const value=element.getAttribute("aria-labelledby");if(value===null)return{authoritative:!1,elements:[]};addLabelReferenceRoot(context,element);const root=element.getRootNode(),canResolveSerialized=typeof root.getElementById=="function",serializedReferences=[];let sawSerializedToken=!1;for(const id of asciiWhitespaceTokens(value,()=>consumeNodeWork(context))){if(sawSerializedToken=!0,!consumeNodeWork(context))return{authoritative:!0,elements:serializedReferences};const reference=canResolveSerialized?root.getElementById(id):null;reference&&serializedReferences.push(reference)}if(sawSerializedToken)return{authoritative:serializedReferences.length>0,elements:serializedReferences};if(context.workUnits>=context.maxNodes||!consumeNodeWork(context))return context.reasons.add("nodes"),{authoritative:!0,elements:[]};if(context.workUnits>=context.maxNodes)return context.reasons.add("nodes"),{authoritative:!0,elements:[]};try{const ElementConstructor=element.ownerDocument.defaultView?.Element,descriptor=ElementConstructor?Object.getOwnPropertyDescriptor(ElementConstructor.prototype,"ariaLabelledByElements"):void 0,reflected=typeof descriptor?.get=="function"?descriptor.get.call(element):void 0;if(reflected?.length){const result=[];for(let index=0;index<reflected.length&&consumeNodeWork(context);index+=1){const reference=reflected[index];!reference||reference.nodeType!==1||(result.push(reference),addLabelReferenceRoot(context,reference))}return{authoritative:!0,elements:result}}}catch{}return{authoritative:!1,elements:[]}}const OWNED_CLOSED_POPUP_SELECTOR='[part~="popup"], .submenu-surface';function hasOwnedClosedPopupAncestor(node){let current=composedParentElement(node);for(;current;){if(current.hidden&&current.matches(OWNED_CLOSED_POPUP_SELECTOR))return!0;current=composedParentElement(current)}return!1}function isAncestorBoundaryExternallyUnrendered(context){if(context.externallyUnrenderedBoundary!==void 0)return context.externallyUnrenderedBoundary;const boundary=context.ancestorBoundary;let result=!1;if(boundary&&!cachedSubtreeExcluded(context,boundary)){const candidate=boundary;if(typeof candidate.checkVisibility=="function")try{result=!candidate.checkVisibility({contentVisibilityAuto:!0})&&hasOwnedClosedPopupAncestor(boundary)}catch{result=!1}}return context.externallyUnrenderedBoundary=result,result}function isRenderedAccessibilityBranch(context,element,display){const imageMapImage=cachedImageMapImage(context,element);if(imageMapImage)return isRenderedAccessibilityBranch(context,imageMapImage,cachedElementState(context,imageMapImage).display);if(!element.isConnected||display==="contents")return!0;const candidate=element;if(typeof candidate.checkVisibility!="function")return!0;try{return candidate.checkVisibility({contentVisibilityAuto:!0})?!0:context.ignoreInheritedVisibility&&isAncestorBoundaryExternallyUnrendered(context)}catch{return!1}}function processAccessibilityTextWork(context){for(;context.stack.length>0;){const work=context.stack.pop();if(work.kind==="text"){appendBoundedText(context,work.value);continue}if(work.kind==="slot"){if(work.index>=work.candidates.length){work.foundAssigned||scheduleNodeList(context,work.fallback,work.depth,work.inheritedTextVisible,work.referenced,work.available);continue}if(!consumeNodeWork(context)){context.stack.length=0;break}const node=work.candidates[work.index],assigned=!!(node&&node.assignedSlot===work.slot);context.stack.push({...work,foundAssigned:work.foundAssigned||assigned,index:work.index+1}),node&&assigned&&(scheduleNode(context,node,work.depth,work.inheritedTextVisible,work.referenced,work.available,!0),work.foundAssigned&&context.stack.push({kind:"text",value:" "}));continue}if(work.kind==="nodes"){if(work.index>=work.nodes.length)continue;const node=work.nodes[work.index];if(!node)continue;context.stack.push({...work,index:work.index+1}),scheduleNode(context,node,work.depth,work.inheritedTextVisible,work.referenced,work.available),work.index>0&&context.stack.push({kind:"text",value:" "});continue}if(context.visited.has(work.node))continue;if(!work.workCharged&&!consumeNodeWork(context)){context.stack.length=0;break}if(context.visited.add(work.node),context.visitedNodes+=1,!work.referenced&&context.shouldPruneNode?.(work.node))continue;if(work.node.nodeType===3){(work.referenced||work.available&&work.inheritedTextVisible)&&appendBoundedText(context,work.node.textContent??"");continue}if(work.node.nodeType===11){"host"in work.node&&context.traversedShadowRoots.add(work.node),scheduleNodeList(context,work.node.childNodes,work.depth+1,work.inheritedTextVisible,work.referenced,work.available);continue}if(work.node.nodeType!==1)continue;const element=work.node;if(NON_CONTENT_ELEMENTS.has(element.localName)||context.shouldPrune?.(element))continue;const state=cachedElementState(context,element),excluded=cachedSubtreeExcluded(context,element),available=work.referenced||work.available&&!excluded;if(!available||!work.referenced&&context.requireRendered&&!isRenderedAccessibilityBranch(context,element,state.display))continue;const ownTextVisible=work.referenced||!state.visibilityHidden||context.visibilityBaselineHidden,labelledBy=ownTextVisible?labelledByElements(context,element):{authoritative:!1,elements:[]};if(labelledBy.elements.length>0){for(const reference of labelledBy.elements)context.referencedElements.add(reference);scheduleNodeList(context,labelledBy.elements,work.depth+1,!0,!0,!0);continue}if(labelledBy.authoritative)continue;const ariaLabel=ownTextVisible?element.getAttribute("aria-label"):null;if(ariaLabel?.trim()){appendBoundedText(context,ariaLabel.trim());continue}if(ownTextVisible&&(element.localName==="img"||element.localName==="area")){const alt=element.getAttribute("alt");if(alt?.trim()){appendBoundedText(context,alt.trim());continue}}scheduleRenderedChildNodes(context,element,work.depth+1,ownTextVisible,work.referenced,available)}}function normalizedTextOptions(options){const resolved=typeof options=="boolean"?{inheritedTextVisible:options}:options??{};return{...resolved,inheritedTextVisible:resolved.inheritedTextVisible??!0,maxCharacters:finiteTextLimit(resolved.maxCharacters,DEFAULT_ACCESSIBILITY_TEXT_MAX_CHARACTERS),maxDepth:finiteTextLimit(resolved.maxDepth,DEFAULT_ACCESSIBILITY_TEXT_MAX_DEPTH),maxNodes:finiteTextLimit(resolved.maxNodes,DEFAULT_ACCESSIBILITY_TEXT_MAX_NODES)}}function composedAccessibilityTextResult(input,options){const resolved=normalizedTextOptions(options),context={ancestorBoundary:resolved.ancestorBoundary??null,elementStates:new Map,excludedElements:new Map,imageMapImages:new Map,isSubtreeExcluded:resolved.isSubtreeExcluded,onElementState:resolved.onElementState,ignoreInheritedVisibility:resolved.skipRootAncestorValidation===!0||resolved.ignoreInheritedVisibility===!0,labelReferenceRoots:new Set,maxCharacters:resolved.maxCharacters,maxDepth:resolved.maxDepth,maxNodes:resolved.maxNodes,output:[],outputLength:0,reasons:new Set,referencedElements:new Set,requireRendered:resolved.requireRendered!==!1,shouldPrune:resolved.shouldPrune,shouldPruneNode:resolved.shouldPruneNode,stack:[],traversedShadowRoots:new Set,visibilityBaselineHidden:!1,visited:new Set,visitedNodes:0,workUnits:0};if(context.maxNodes===0)return context.reasons.add("nodes"),{labelReferenceRoots:context.labelReferenceRoots,referencedElements:context.referencedElements,text:"",traversedShadowRoots:context.traversedShadowRoots,truncated:!0,truncationReasons:[...context.reasons],visitedNodes:0};const roots=isNodeValue(input)?[input]:input;let rootCount=0;for(const root of roots){if(!isNodeValue(root))continue;if(context.workUnits>=context.maxNodes){context.reasons.add("nodes");break}if(rootCount>0&&appendBoundedText(context," "),context.reasons.has("characters"))break;const validated=resolved.skipRootAncestorValidation?{available:!0,inheritedTextVisible:!0}:composedAncestorState(context,root);context.visibilityBaselineHidden=(root.nodeType===1||!resolved.skipRootAncestorValidation)&&context.ignoreInheritedVisibility&&inheritedVisibilityHidden(context,root);const ancestorState=context.visibilityBaselineHidden?{available:validated.available,inheritedTextVisible:!0}:validated;if(scheduleNode(context,root,0,resolved.inheritedTextVisible&&ancestorState.inheritedTextVisible,!1,ancestorState.available),processAccessibilityTextWork(context),rootCount+=1,context.reasons.has("characters")||context.reasons.has("nodes")&&context.workUnits>=context.maxNodes)break}return{labelReferenceRoots:context.labelReferenceRoots,referencedElements:context.referencedElements,text:context.output.join(""),traversedShadowRoots:context.traversedShadowRoots,truncated:context.reasons.size>0,truncationReasons:[...context.reasons],visitedNodes:context.visitedNodes}}function composedAccessibilityText(input,options){return composedAccessibilityTextResult(input,options).text}function composedAccessibleVisibleText(node){return composedAccessibilityText(node)}function isClosedDetailsContentBranchWithin(details,branch,consume){if(details.localName!=="details"||details.hasAttribute("open")||branch===null)return!1;let summary=null;for(const child of details.children){if(!consume())return!0;if(child.localName==="summary"){summary=child;break}}return branch!==summary}function isClosedDetailsContentBranchBounded(context,details,branch){if(details.localName!=="details"||details.hasAttribute("open")||branch===null)return!1;for(const child of details.children){if(!consumeNodeWork(context))return!0;if(child.localName==="summary")return child!==branch}return!0}function isAccessibilityVisible(element,options={}){if(!element.isConnected)return!1;const maxDepth=finiteTextLimit(options.maxDepth,DEFAULT_ACCESSIBILITY_TEXT_MAX_DEPTH),maxNodes=finiteTextLimit(options.maxNodes,DEFAULT_ACCESSIBILITY_VISIBILITY_MAX_NODES);let workUnits=0;const consume=()=>workUnits>=maxNodes?!1:(workUnits+=1,!0);let current=element,composedChild=null,depth=0,targetState,renderedSource=element;for(;current;){if(depth>maxDepth||!consume())return!1;const imageMapImage=imageMapImageFor(current,{consume}),state=accessibilityElementState(current,imageMapImage);if(current===element&&(targetState=state,renderedSource=imageMapImage??element),!options.ignorePresentation?.(current)&&(state.subtreeExcluded||isClosedDetailsContentBranchWithin(current,composedChild,consume)||current===element&&state.visibilityHidden))return!1;composedChild=current,current=composedParentElement(current),depth+=1}if(renderedSource!==element)for(current=renderedSource,composedChild=null,depth=0;current;){if(depth>maxDepth||!consume())return!1;const state=accessibilityElementState(current,imageMapImageFor(current,{consume}));if(current===renderedSource&&(targetState=state),!options.ignorePresentation?.(current)&&(state.subtreeExcluded||isClosedDetailsContentBranchWithin(current,composedChild,consume)||current===renderedSource&&state.visibilityHidden))return!1;composedChild=current,current=composedParentElement(current),depth+=1}if(targetState?.display==="contents")return!0;const visibilityTarget=renderedSource;if(!consume())return!1;try{return typeof visibilityTarget.checkVisibility=="function"?visibilityTarget.checkVisibility({contentVisibilityAuto:!0}):!0}catch{return!1}}export{bindAccessibleTextObserver,composedAccessibilityText,composedAccessibilityTextResult,composedAccessibleVisibleText,composedParentElement2 as composedParentElement,isAccessibilityExcluded,isAccessibilitySubtreeExcluded,isAccessibilityVisibilityHidden,isAccessibilityVisible,isAriaTrue};
@@ -1 +1 @@
1
- import{css,unsafeCSS}from"lit";function glassSurface(selector,fill,restingFill=fill,scrolling=!1){const surface=unsafeCSS(selector),selectors=selector.split(",").map(part=>part.trim()),children=unsafeCSS(`:where(${selectors.map(part=>`${part} > *`).join(", ")})`),layer=unsafeCSS(selectors.map(part=>`${part}${scrolling?" > .glass-scroll-layer":""}::before`).join(", ")),captureSurface=unsafeCSS(`:where(${selector})`),scopedSelectors=selectors.map(part=>/^:host\((.*)\)$/.test(part)?part.replace(/^:host\((.*)\)$/,":host($1[data-lr-surface='glass'])"):`${part}[data-lr-surface='glass']`),captureScope=unsafeCSS(`:where(${scopedSelectors.join(", ")})`),captureChildren=unsafeCSS(`:where(${scopedSelectors.map(part=>`${part} > *`).join(", ")})`);return css` :host([data-lr-surface='solid']) { --_lr-surface-enabled: 0; --_lr-surface-root-filter: none; --_lr-surface-content: none; --_lr-surface-isolation: auto; --_lr-surface-child-filter: initial; --_lr-surface-child-opacity: 0; } ${surface} { background: ${restingFill}; --_lr-glass-filter-value: blur(calc(clamp(0px, var(--lr-theme-surface-blur, var(--_lr-surface-default-blur)), var(--_lr-surface-maximum-blur, var(--_lr-surface-default-maximum-blur))) * (1 - var(--_lr-glass-parent-opacity, 0)))) saturate(calc(1 + (clamp(0, var(--lr-theme-surface-saturation, 1.1), 2) - 1) * (1 - var(--_lr-glass-parent-opacity, 0)))); --_lr-glass-current-filter: var(--_lr-preference-glass-filter, var(--_lr-glass-blocker, var(--_lr-glass-filter-value, none))); --_lr-glass-foreground-weight: initial; --_lr-glass-border-weight: initial; --_lr-next-glass-blocker: var(--_lr-surface-child-filter, none); } ${captureSurface} { --_lr-next-glass-opacity: var(--_lr-surface-child-opacity, 1); } ${captureScope} { --_lr-next-glass-opacity: inherit; } ${captureChildren} { --_lr-next-glass-opacity: 1; } ${children} { --_lr-glass-blocker: var(--_lr-next-glass-blocker, initial); --_lr-glass-parent-opacity: var(--_lr-next-glass-opacity, initial); } :host([data-lr-surface='solid']), [data-lr-surface='solid'] { --_lr-glass-parent-opacity: 0; --_lr-next-glass-opacity: 0; --_lr-glass-blocker: none; } :host([data-lr-surface='glass']), [data-lr-surface='glass'] { --_lr-glass-blocker: initial; } @supports ((backdrop-filter: blur(0)) or (-webkit-backdrop-filter: blur(0))) { :host { --_lr-glass-qualified-focus-ring-color: color-mix( in srgb, var(--_lr-glass-original-focus-ring-color, var(--lr-color-text)), var(--lr-color-text) calc(var(--_lr-surface-foreground-weight, 99%) * var(--_lr-surface-enabled, 1) * (1 - var(--_lr-glass-parent-opacity, 0)) * (1 - var(--_lr-preference-glass-opacity, 0))) ); } ${surface} { isolation: var(--_lr-surface-isolation, isolate); --_lr-glass-effective-opacity: var(--_lr-preference-glass-opacity, max(var(--_lr-glass-parent-opacity, 0), clamp(var(--_lr-surface-min-opacity, 0), var(--lr-theme-surface-opacity, 0.7), 1))); --_lr-glass-border-weight: clamp(0%, calc(var(--_lr-surface-border-weight, 285%) * var(--_lr-surface-enabled, 1) * (1 - var(--_lr-glass-effective-opacity))), var(--_lr-surface-foreground-weight, 99%)); --_lr-glass-foreground-weight: calc(var(--_lr-surface-foreground-weight, 99%) * var(--_lr-surface-enabled, 1) * (1 - var(--_lr-glass-parent-opacity, 0)) * (1 - var(--_lr-preference-glass-opacity, 0))); --_lr-glass-qualified-text-quiet: color-mix(in srgb, var(--_lr-glass-original-text-quiet, var(--lr-color-text)), var(--lr-color-text) var(--_lr-glass-foreground-weight)); --lr-color-text-quiet: var(--_lr-glass-qualified-text-quiet, var(--_lr-glass-original-text-quiet)); --_lr-glass-qualified-border: color-mix(in srgb, var(--_lr-glass-original-border, var(--lr-color-text)), var(--lr-color-text) var(--_lr-glass-border-weight)); --lr-color-border: var(--_lr-glass-qualified-border, var(--_lr-glass-original-border)); --_lr-glass-qualified-border-strong: color-mix(in srgb, var(--_lr-glass-original-border-strong, var(--_lr-glass-original-border, var(--lr-color-text))), var(--lr-color-text) var(--_lr-glass-border-weight)); --lr-color-border-strong: var(--_lr-glass-qualified-border-strong, var(--_lr-glass-original-border-strong)); --_lr-glass-brand-text: color-mix(in srgb, var(--lr-color-brand), var(--lr-color-text) var(--_lr-glass-foreground-weight)); --_lr-glass-danger-text: color-mix(in srgb, var(--lr-color-danger), var(--lr-color-text) var(--_lr-glass-foreground-weight)); --_lr-glass-background: color-mix( in srgb, ${restingFill} calc((1 - var(--_lr-surface-enabled, 1) * (1 - var(--_lr-preference-glass-opacity, 0))) * 100%), color-mix( in srgb, ${fill} calc(var(--_lr-glass-effective-opacity) * 100%), transparent ) ); background: var(--_lr-glass-background, ${restingFill}); } ${layer} { content: var(--_lr-surface-content, ''); position: absolute; inset: 0; inline-size: ${scrolling?css`var(--_lr-glass-viewport-width, 100%)`:css`auto`}; block-size: ${scrolling?css`var(--_lr-glass-viewport-height, 100%)`:css`auto`}; z-index: calc(var(--lr-layer-base) - var(--lr-layer-content)); pointer-events: none; border-radius: inherit; -webkit-backdrop-filter: var(--_lr-glass-current-filter); backdrop-filter: var(--_lr-glass-current-filter); box-shadow: inset 0 var(--lr-border-width-thin) 0 var(--lr-theme-surface-highlight, var(--_lr-surface-default-highlight)); } } @media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) { ${surface} { background: ${restingFill}; --_lr-glass-foreground-weight: initial; --_lr-glass-border-weight: initial; } ${layer} { content: none; -webkit-backdrop-filter: none; backdrop-filter: none; } } @media (forced-colors: active) { ${surface} { background: Canvas; } } `}export{glassSurface};
1
+ import{css,unsafeCSS}from"lit";function glassSurface(selector,fill,restingFill=fill,scrolling=!1){const surface=unsafeCSS(selector),selectors=selector.split(",").map(part=>part.trim()),children=unsafeCSS(`:where(${selectors.map(part=>`${part} > *`).join(", ")})`),layer=unsafeCSS(selectors.map(part=>`${part}${scrolling?" > .glass-scroll-layer":""}::before`).join(", ")),captureSurface=unsafeCSS(`:where(${selector})`),scopedSelectors=selectors.map(part=>/^:host\((.*)\)$/.test(part)?part.replace(/^:host\((.*)\)$/,":host($1[data-lr-surface='glass'])"):`${part}[data-lr-surface='glass']`),captureScope=unsafeCSS(`:where(${scopedSelectors.join(", ")})`),captureChildren=unsafeCSS(`:where(${scopedSelectors.map(part=>`${part} > *`).join(", ")})`);return css` :host([data-lr-surface='solid']) { --_lr-surface-enabled: 0; --_lr-surface-root-filter: none; --_lr-surface-content: none; --_lr-surface-isolation: auto; --_lr-surface-child-filter: initial; --_lr-surface-child-opacity: 0; } ${surface} { background: ${restingFill}; --_lr-glass-filter-value: blur(calc(clamp(0px, var(--lr-theme-surface-blur, var(--_lr-surface-default-blur)), var(--_lr-surface-maximum-blur, var(--_lr-surface-default-maximum-blur))) * (1 - var(--_lr-glass-parent-opacity, 0)))) saturate(calc(1 + (clamp(0, var(--lr-theme-surface-saturation, 1.1), 2) - 1) * (1 - var(--_lr-glass-parent-opacity, 0)))); --_lr-glass-current-filter: var(--_lr-preference-glass-filter, var(--_lr-glass-blocker, var(--_lr-glass-filter-value, none))); --_lr-glass-foreground-weight: initial; --_lr-glass-border-weight: initial; --_lr-next-glass-blocker: var(--_lr-surface-child-filter, none); } ${captureSurface} { --_lr-next-glass-opacity: var(--_lr-surface-child-opacity, 1); } ${captureScope} { --_lr-next-glass-opacity: inherit; } ${captureChildren} { --_lr-next-glass-opacity: 1; } ${children} { --_lr-glass-blocker: var(--_lr-next-glass-blocker, initial); --_lr-glass-parent-opacity: var(--_lr-next-glass-opacity, initial); } :host([data-lr-surface='solid']), [data-lr-surface='solid'] { --_lr-glass-parent-opacity: 0; --_lr-next-glass-opacity: 0; --_lr-glass-blocker: none; } :host([data-lr-surface='glass']), [data-lr-surface='glass'] { --_lr-glass-blocker: initial; } @supports ((backdrop-filter: blur(0)) or (-webkit-backdrop-filter: blur(0))) { :host { --_lr-glass-qualified-focus-ring-color: color-mix( in srgb, var(--_lr-glass-original-focus-ring-color, var(--lr-color-text)), var(--lr-color-text) calc(var(--_lr-surface-foreground-weight, 99%) * var(--_lr-surface-enabled, 1) * (1 - var(--_lr-glass-parent-opacity, 0)) * (1 - var(--_lr-preference-glass-opacity, 0))) ); } ${surface} { isolation: var(--_lr-surface-isolation, isolate); --_lr-glass-effective-opacity: var(--_lr-preference-glass-opacity, max(var(--_lr-glass-parent-opacity, 0), clamp(var(--_lr-surface-min-opacity, 0), var(--lr-theme-surface-opacity, 0.6), 1))); --_lr-glass-border-weight: clamp(0%, calc(var(--_lr-surface-border-weight, 285%) * var(--_lr-surface-enabled, 1) * (1 - var(--_lr-glass-effective-opacity))), var(--_lr-surface-foreground-weight, 99%)); --_lr-glass-foreground-weight: calc(var(--_lr-surface-foreground-weight, 99%) * var(--_lr-surface-enabled, 1) * (1 - var(--_lr-glass-parent-opacity, 0)) * (1 - var(--_lr-preference-glass-opacity, 0))); --_lr-glass-qualified-text-quiet: color-mix(in srgb, var(--_lr-glass-original-text-quiet, var(--lr-color-text)), var(--lr-color-text) var(--_lr-glass-foreground-weight)); --lr-color-text-quiet: var(--_lr-glass-qualified-text-quiet, var(--_lr-glass-original-text-quiet)); --_lr-glass-qualified-border: color-mix(in srgb, var(--_lr-glass-original-border, var(--lr-color-text)), var(--lr-color-text) var(--_lr-glass-border-weight)); --lr-color-border: var(--_lr-glass-qualified-border, var(--_lr-glass-original-border)); --_lr-glass-qualified-border-strong: color-mix(in srgb, var(--_lr-glass-original-border-strong, var(--_lr-glass-original-border, var(--lr-color-text))), var(--lr-color-text) var(--_lr-glass-border-weight)); --lr-color-border-strong: var(--_lr-glass-qualified-border-strong, var(--_lr-glass-original-border-strong)); --_lr-glass-brand-text: color-mix(in srgb, var(--lr-color-brand), var(--lr-color-text) var(--_lr-glass-foreground-weight)); --_lr-glass-danger-text: color-mix(in srgb, var(--lr-color-danger), var(--lr-color-text) var(--_lr-glass-foreground-weight)); --_lr-glass-dark-fill-weight: clamp(20%, calc(var(--_lr-glass-effective-opacity) * 800% - 460%), 100%); --_lr-glass-fill: light-dark(${fill}, color-mix(in srgb, ${fill} var(--_lr-glass-dark-fill-weight), var(--_lr-glass-dark-anchor))); --_lr-glass-background: color-mix( in srgb, ${restingFill} calc((1 - var(--_lr-surface-enabled, 1) * (1 - var(--_lr-preference-glass-opacity, 0))) * 100%), color-mix( in srgb, var(--_lr-glass-fill) calc(var(--_lr-glass-effective-opacity) * 100%), transparent ) ); background: var(--_lr-glass-background, ${restingFill}); } ${layer} { content: var(--_lr-surface-content, ''); position: absolute; inset: 0; inline-size: ${scrolling?css`var(--_lr-glass-viewport-width, 100%)`:css`auto`}; block-size: ${scrolling?css`var(--_lr-glass-viewport-height, 100%)`:css`auto`}; z-index: calc(var(--lr-layer-base) - var(--lr-layer-content)); pointer-events: none; border-radius: inherit; -webkit-backdrop-filter: var(--_lr-glass-current-filter); backdrop-filter: var(--_lr-glass-current-filter); box-shadow: inset 0 var(--lr-border-width-thin) 0 var(--lr-theme-surface-highlight, var(--_lr-surface-default-highlight)); } } @media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) { ${surface} { background: ${restingFill}; --_lr-glass-foreground-weight: initial; --_lr-glass-border-weight: initial; } ${layer} { content: none; -webkit-backdrop-filter: none; backdrop-filter: none; } } @media (forced-colors: active) { ${surface} { background: Canvas; } } `}export{glassSurface};
@@ -2,4 +2,4 @@
2
2
  * Generated from package.json by scripts/generate-package-metadata.mjs.
3
3
  * Run `pnpm package-metadata` after changing package identity or version.
4
4
  */
5
- export declare const LYRA_PACKAGE_NAME:'@aceshooting/lyra-ui';export declare const LYRA_PACKAGE_VERSION:'25.6.1';
5
+ export declare const LYRA_PACKAGE_NAME:'@aceshooting/lyra-ui';export declare const LYRA_PACKAGE_VERSION:'25.6.2';
@@ -1 +1 @@
1
- const LYRA_PACKAGE_NAME="@aceshooting/lyra-ui",LYRA_PACKAGE_VERSION="25.6.1";export{LYRA_PACKAGE_NAME,LYRA_PACKAGE_VERSION};
1
+ const LYRA_PACKAGE_NAME="@aceshooting/lyra-ui",LYRA_PACKAGE_VERSION="25.6.2";export{LYRA_PACKAGE_NAME,LYRA_PACKAGE_VERSION};
@@ -1 +1 @@
1
- import{css}from"lit";const baseTokens=css`:host{--_lr-surface-default-blur:12px;--_lr-surface-default-maximum-blur:16px;--_lr-surface-default-highlight:#ffffff1f;--lr-color-surface:var(--lr-theme-color-surface-default,#fff);--lr-color-surface-raised:var(--lr-theme-color-surface-raised,#fafafa);--lr-color-surface-container-lowest:var(--lr-theme-color-surface-container-lowest,var(--lr-color-surface));--lr-color-surface-container-low:var(--lr-theme-color-surface-container-low,var(--lr-color-surface));--lr-color-surface-container:var(--lr-theme-color-surface-container,var(--lr-color-surface-raised));--lr-color-surface-container-high:var(--lr-theme-color-surface-container-high,var(--lr-color-surface-overlay));--lr-color-surface-container-highest:var(--lr-theme-color-surface-container-highest,var(--lr-color-surface-overlay));--lr-color-text:var(--lr-theme-color-text-normal,#0a0a0a);--_lr-glass-original-text-quiet:var(--_lr-preference-quiet-color,var(--lr-theme-color-text-quiet,#737373));--_lr-glass-qualified-text-quiet:color-mix(in srgb, var(--_lr-preference-quiet-color,var(--lr-theme-color-text-quiet,#737373)), var(--lr-color-text) var(--_lr-glass-foreground-weight));--lr-color-text-quiet:var(--_lr-glass-qualified-text-quiet,var(--_lr-preference-quiet-color,var(--lr-theme-color-text-quiet,#737373)));--_lr-glass-original-border:var(--_lr-preference-control-color,var(--lr-theme-color-surface-border,#919191));--_lr-glass-qualified-border:color-mix(in srgb, var(--_lr-preference-control-color,var(--lr-theme-color-surface-border,#919191)), var(--lr-color-text) var(--_lr-glass-border-weight));--lr-color-border:var(--_lr-glass-qualified-border,var(--_lr-preference-control-color,var(--lr-theme-color-surface-border,#919191)));--_lr-glass-original-border-strong:var(--_lr-preference-control-color,var(--lr-theme-color-border-strong,#919191));--_lr-glass-qualified-border-strong:color-mix(in srgb, var(--_lr-preference-control-color,var(--lr-theme-color-border-strong,#919191)), var(--lr-color-text) var(--_lr-glass-border-weight));--lr-color-border-strong:var(--_lr-glass-qualified-border-strong,var(--_lr-preference-control-color,var(--lr-theme-color-border-strong,#919191)));--lr-color-border-subtle:var(--_lr-preference-control-color,var(--lr-theme-color-surface-border-subtle,color-mix(in srgb, #e5e5e5 var(--_lr-subtle-mix,100%), var(--lr-color-border))));--_lr-glass-brand-text:color-mix(in srgb, var(--lr-color-brand), var(--lr-color-text) var(--_lr-glass-foreground-weight));--_lr-glass-danger-text:color-mix(in srgb, var(--lr-color-danger), var(--lr-color-text) var(--_lr-glass-foreground-weight));--lr-color-brand:var(--lr-color-brand-fill-loud);--lr-color-brand-quiet:var(--lr-color-brand-fill-quiet);--lr-color-success:var(--lr-color-success-fill-loud);--lr-color-success-quiet:var(--lr-color-success-fill-quiet);--lr-color-warning:var(--lr-color-warning-fill-loud);--lr-color-warning-quiet:var(--lr-color-warning-fill-quiet);--lr-color-danger:var(--lr-color-danger-fill-loud);--lr-color-danger-quiet:var(--lr-color-danger-fill-quiet);--lr-color-neutral:var(--lr-color-neutral-fill-loud);--lr-color-on-brand:var(--lr-color-brand-on-loud);--lr-color-on-success:var(--lr-color-success-on-loud);--lr-color-on-warning:var(--lr-color-warning-on-loud);--lr-color-on-danger:var(--lr-color-danger-on-loud);--lr-color-on-neutral:var(--lr-color-neutral-on-loud);--lr-color-on-strong-overlay:var(--lr-theme-color-on-strong-overlay,#fff);--lr-color-surface-overlay:var(--lr-theme-color-surface-overlay,#fff);--lr-color-overlay:var(--lr-theme-color-overlay,#00000080);--lr-color-overlay-strong:var(--lr-theme-color-overlay-strong,#000000eb);--lr-color-no-data:var(--lr-theme-color-no-data,#80808040);--lr-font-mono:var(--lr-theme-font-family-mono,"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);--lr-space-xs:var(--lr-theme-space-xs,.25rem);--lr-space-s:var(--lr-theme-space-s,.5rem);--lr-space-m:var(--lr-theme-space-m,.75rem);--lr-space-l:var(--lr-theme-space-l,1rem);--lr-space-2xs:var(--lr-theme-space-2xs,.125rem);--lr-space-2xl:var(--lr-theme-space-2xl,2rem);--lr-font-size-3xs:var(--lr-theme-font-size-3xs,.5rem);--lr-font-size-2xs:var(--lr-theme-font-size-2xs,.625rem);--lr-font-size-xs:var(--lr-theme-font-size-xs,.75rem);--lr-font-size-sm:var(--lr-theme-font-size-sm,.8125rem);--lr-font-size-m:var(--lr-theme-font-size-m,.875rem);--lr-font-size-md-sm:var(--lr-theme-font-size-md-sm,.875rem);--lr-font-size-lg:var(--lr-theme-font-size-lg,1.125rem);--lr-font-size-xl:var(--lr-theme-font-size-xl,1.25rem);--lr-font-size-2xl:var(--lr-theme-font-size-2xl,1.75rem);--lr-font-size-3xl:var(--lr-theme-font-size-3xl,2rem);--lr-font-weight-normal:var(--lr-theme-font-weight-normal,400);--lr-font-weight-medium:var(--lr-theme-font-weight-medium,500);--lr-font-weight-semibold:var(--lr-theme-font-weight-semibold,600);--lr-font-weight-bold:var(--lr-theme-font-weight-bold,700);--lr-line-height-none:var(--lr-theme-line-height-none,1);--lr-line-height-compact:var(--lr-theme-line-height-compact,1.25);--lr-line-height-snug:var(--lr-theme-line-height-snug,1.3);--lr-line-height-1-4:var(--lr-theme-line-height-1-4,1.4);--lr-line-height-normal:var(--lr-theme-line-height-normal,1.5);--lr-line-height-loose:var(--lr-theme-line-height-loose,1.6);--lr-line-break:var(--lr-theme-line-break,inherit);--lr-word-break:var(--lr-theme-word-break,inherit);--lr-border-width-thin:var(--lr-theme-border-width-thin,1px);--lr-border-width-medium:var(--lr-theme-border-width-medium,2px);--lr-border-width-thick:var(--lr-theme-border-width-thick,3px);--lr-radius-xs:var(--lr-theme-border-radius-xs,.25rem);--lr-radius-pill:var(--lr-theme-border-radius-pill,999px);--lr-color-shadow:var(--lr-theme-color-shadow,#000);--lr-mask-opaque:#000;--lr-layer-base:var(--lr-theme-z-index-base,0);--lr-layer-content:var(--lr-theme-z-index-content,1);--lr-layer-dropdown:var(--lr-theme-z-index-dropdown,900);--lr-layer-popover:var(--lr-theme-z-index-popover,1000);--lr-layer-modal:var(--lr-theme-z-index-modal,1000);--lr-layer-toast:var(--lr-theme-z-index-toast,9999);--lr-safe-area-top:env(safe-area-inset-top,0px);--lr-safe-area-bottom:env(safe-area-inset-bottom,0px);--lr-safe-area-inline-start:env(safe-area-inset-left,0px);--lr-safe-area-inline-end:env(safe-area-inset-right,0px);--lr-size-neg-0-15rem:var(--lr-theme-size-neg-0-15rem,-.15rem);--lr-size-neg-0-25rem:var(--lr-theme-size-neg-0-25rem,-.25rem);--lr-size-neg-1px:var(--lr-theme-size-neg-1px,-1px);--lr-size-neg-4px:var(--lr-theme-size-neg-4px,-4px);--lr-size-neg-6px:var(--lr-theme-size-neg-6px,-6px);--lr-size-neg-8px:var(--lr-theme-size-neg-8px,-8px);--lr-size-0-02em:var(--lr-theme-size-0-02em,.02em);--lr-size-0-03em:var(--lr-theme-size-0-03em,.03em);--lr-size-0-04em:var(--lr-theme-size-0-04em,.04em);--lr-size-0-05rem:var(--lr-theme-size-0-05rem,.05rem);--lr-size-0-0625rem:var(--lr-theme-size-0-0625rem,.0625rem);--lr-size-0-09375rem:var(--lr-theme-size-0-09375rem,.09375rem);--lr-size-0-125rem:var(--lr-theme-size-0-125rem,.125rem);--lr-size-0-15rem:var(--lr-theme-size-0-15rem,.15rem);--lr-size-0-1875rem:var(--lr-theme-size-0-1875rem,.1875rem);--lr-size-0-1rem:var(--lr-theme-size-0-1rem,.1rem);--lr-size-0-25rem:var(--lr-theme-size-0-25rem,.25rem);--lr-size-0-3125rem:var(--lr-theme-size-0-3125rem,.3125rem);--lr-size-0-35em:var(--lr-theme-size-0-35em,.35em);--lr-size-0-375rem:var(--lr-theme-size-0-375rem,.375rem);--lr-size-0-3em:var(--lr-theme-size-0-3em,.3em);--lr-size-0-4375rem:var(--lr-theme-size-0-4375rem,.4375rem);--lr-size-0-4em:var(--lr-theme-size-0-4em,.4em);--lr-size-0-4rem:var(--lr-theme-size-0-4rem,.4rem);--lr-size-0-5em:var(--lr-theme-size-0-5em,.5em);--lr-size-0-5rem:var(--lr-theme-size-0-5rem,.5rem);--lr-size-0-625rem:var(--lr-theme-size-0-625rem,.625rem);--lr-size-0-6875rem:var(--lr-theme-size-0-6875rem,.6875rem);--lr-size-0-6rem:var(--lr-theme-size-0-6rem,.6rem);--lr-size-0-75em:var(--lr-theme-size-0-75em,.75em);--lr-size-0-75rem:var(--lr-theme-size-0-75rem,.75rem);--lr-size-0-7em:var(--lr-theme-size-0-7em,.7em);--lr-size-0-875em:var(--lr-theme-size-0-875em,.875em);--lr-size-0-8rem:var(--lr-theme-size-0-8rem,.8rem);--lr-size-0-9375rem:var(--lr-theme-size-0-9375rem,.9375rem);--lr-size-1-0625rem:var(--lr-theme-size-1-0625rem,1.0625rem);--lr-size-1-1rem:var(--lr-theme-size-1-1rem,1.1rem);--lr-size-1-25rem:var(--lr-theme-size-1-25rem,1.25rem);--lr-size-1-5em:var(--lr-theme-size-1-5em,1.5em);--lr-size-1-5rem:var(--lr-theme-size-1-5rem,1.5rem);--lr-size-1-75rem:var(--lr-theme-size-1-75rem,1.75rem);--lr-size-1-875rem:var(--lr-theme-size-1-875rem,1.875rem);--lr-size-10px:var(--lr-theme-size-10px,10px);--lr-size-10rem:var(--lr-theme-size-10rem,10rem);--lr-size-12em:var(--lr-theme-size-12em,12em);--lr-size-12rem:var(--lr-theme-size-12rem,12rem);--lr-size-14px:var(--lr-theme-size-14px,14px);--lr-size-14rem:var(--lr-theme-size-14rem,14rem);--lr-size-15rem:var(--lr-theme-size-15rem,15rem);--lr-size-16px:var(--lr-theme-size-16px,16px);--lr-size-16rem:var(--lr-theme-size-16rem,16rem);--lr-size-18rem:var(--lr-theme-size-18rem,18rem);--lr-size-1em:var(--lr-theme-size-1em,1em);--lr-size-1px:var(--lr-theme-size-1px,1px);--lr-size-1rem:var(--lr-theme-size-1rem,1rem);--lr-size-2-25rem:var(--lr-theme-size-2-25rem,2.25rem);--lr-size-2-5rem:var(--lr-theme-size-2-5rem,2.5rem);--lr-size-2-5ch:var(--lr-theme-size-2-5ch,2.5ch);--lr-size-20rem:var(--lr-theme-size-20rem,20rem);--lr-size-22rem:var(--lr-theme-size-22rem,22rem);--lr-size-24px:var(--lr-theme-size-24px,24px);--lr-size-24rem:var(--lr-theme-size-24rem,24rem);--lr-size-280px:var(--lr-theme-size-280px,280px);--lr-size-28px:var(--lr-theme-size-28px,28px);--lr-size-28rem:var(--lr-theme-size-28rem,28rem);--lr-size-2px:var(--lr-theme-size-2px,2px);--lr-size-2rem:var(--lr-theme-size-2rem,2rem);--lr-size-3-5rem:var(--lr-theme-size-3-5rem,3.5rem);--lr-size-30rem:var(--lr-theme-size-30rem,30rem);--lr-size-32rem:var(--lr-theme-size-32rem,32rem);--lr-size-36rem:var(--lr-theme-size-36rem,36rem);--lr-size-38rem:var(--lr-theme-size-38rem,38rem);--lr-size-3px:var(--lr-theme-size-3px,3px);--lr-size-3rem:var(--lr-theme-size-3rem,3rem);--lr-scroll-fade-size:var(--lr-theme-scroll-fade-size,2rem);--lr-size-3ch:var(--lr-theme-size-3ch,3ch);--lr-size-3-5em:var(--lr-theme-size-3-5em,3.5em);--lr-size-48rem:var(--lr-theme-size-48rem,48rem);--lr-size-4px:var(--lr-theme-size-4px,4px);--lr-size-4rem:var(--lr-theme-size-4rem,4rem);--lr-size-4ch:var(--lr-theme-size-4ch,4ch);--lr-size-5em:var(--lr-theme-size-5em,5em);--lr-size-5rem:var(--lr-theme-size-5rem,5rem);--lr-size-6em:var(--lr-theme-size-6em,6em);--lr-size-6px:var(--lr-theme-size-6px,6px);--lr-size-6rem:var(--lr-theme-size-6rem,6rem);--lr-size-6ch:var(--lr-theme-size-6ch,6ch);--lr-size-7rem:var(--lr-theme-size-7rem,7rem);--lr-size-8em:var(--lr-theme-size-8em,8em);--lr-size-8rem:var(--lr-theme-size-8rem,8rem);--lr-radius:var(--lr-theme-border-radius-m,.5rem);--lr-radius-button:var(--lr-theme-border-radius-button,var(--lr-form-control-radius,var(--lr-radius)));--lr-radius-container:var(--lr-theme-border-radius-container,var(--lr-radius));--lr-table-row-min-height:var(--lr-theme-table-row-height,0px);--lr-shadow-color:var(--lr-theme-shadow-color,0 0 0);--lr-shadow-xs:var(--lr-theme-shadow-xs,0 1px 2px 0 rgb(var(--lr-theme-shadow-color,0 0 0) / .05));--lr-shadow-s:var(--lr-theme-shadow-s,0 1px 3px 0 rgb(var(--lr-theme-shadow-color,0 0 0) / .1), 0 1px 2px -1px rgb(var(--lr-theme-shadow-color,0 0 0) / .1));--lr-shadow-m:var(--lr-theme-shadow-m,0 4px 6px -1px rgb(var(--lr-theme-shadow-color,0 0 0) / .1), 0 2px 4px -2px rgb(var(--lr-theme-shadow-color,0 0 0) / .1));--lr-shadow-l:var(--lr-theme-shadow-l,0 10px 15px -3px rgb(var(--lr-theme-shadow-color,0 0 0) / .1), 0 4px 6px -4px rgb(var(--lr-theme-shadow-color,0 0 0) / .1));--lr-shadow-xl:var(--lr-theme-shadow-xl,0 20px 25px -5px rgb(var(--lr-theme-shadow-color,0 0 0) / .1), 0 8px 10px -6px rgb(var(--lr-theme-shadow-color,0 0 0) / .1));--lr-shadow:var(--lr-shadow-m);--lr-font:var(--lr-theme-font-family-body,"Geist", "Inter", ui-sans-serif, system-ui, sans-serif);--lr-font-heading:var(--lr-theme-font-family-heading,inherit);--lr-duration-fast:var(--_lr-motion-duration,var(--lr-theme-duration-fast,.12s));--lr-duration-base:var(--_lr-motion-duration,var(--lr-theme-duration-normal,.18s));--lr-duration-ambient:var(--_lr-motion-duration,var(--lr-theme-duration-slow,1.8s));--lr-duration-icon:var(--_lr-motion-duration,var(--lr-theme-duration-icon,1s));--lr-otp-input-segment-size:var(--lr-theme-otp-input-segment-size,2.5em);--lr-easing-standard:var(--_lr-motion-easing,var(--lr-theme-easing-standard,ease-out));--lr-easing-emphasized:var(--_lr-motion-easing,var(--lr-theme-easing-emphasized,ease-in-out));--lr-easing-linear:var(--lr-theme-easing-linear,linear);--lr-transition-fast:var(--_lr-motion-transition,var(--lr-theme-transition-fast,.12s ease-out));--lr-transition-base:var(--_lr-motion-transition,var(--lr-theme-transition-normal,.18s ease-out));--lr-transition-ambient:var(--_lr-motion-transition,var(--lr-theme-transition-slow,1.8s ease-in-out));--lr-transition-interactive:background-color var(--lr-transition-fast), color var(--lr-transition-fast), border-color var(--lr-transition-fast);--lr-opacity-disabled:var(--lr-theme-opacity-disabled,.5);--lr-opacity-muted:var(--lr-theme-opacity-muted,.85);--lr-color-mix-hover:var(--lr-theme-color-mix-hover,12%);--lr-color-mix-active:var(--lr-theme-color-mix-active,22%);--lr-color-mix-partner:var(--lr-theme-color-mix-partner,#737373);--lr-hover-brightness:var(--lr-theme-hover-brightness,1.08);--lr-popover-viewport-clamp:var(--lr-theme-popover-viewport-clamp,92vw);--lr-focus-ring-width:max(var(--lr-theme-focus-ring-width,3px), var(--_lr-preference-focus-min,0px));--_lr-glass-original-focus-ring-color:var(--lr-theme-color-focus,#1f7f5c);--_lr-glass-qualified-focus-ring-color:color-mix(in srgb, var(--lr-theme-color-focus,#1f7f5c), var(--lr-color-text) var(--_lr-glass-foreground-weight));--lr-focus-ring-color:var(--_lr-glass-qualified-focus-ring-color,var(--lr-theme-color-focus,#1f7f5c));--lr-focus-ring-offset:var(--lr-theme-focus-ring-offset,0px);--lr-focus-ring:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);--lr-icon-button-size:var(--lr-icon-button-size-scope,var(--lr-theme-icon-button-size,2.25rem));font-family:var(--lr-font);line-break:var(--lr-line-break);word-break:var(--lr-word-break);color:var(--lr-color-text);box-sizing:border-box}:where(h1,h2,h3,h4,h5,h6,[role=heading],[part~=heading]){font-family:var(--lr-font-heading)}:host(:dir(rtl)){--lr-safe-area-inline-start:env(safe-area-inset-right,0px);--lr-safe-area-inline-end:env(safe-area-inset-left,0px)}@media (hover:none),(pointer:coarse){:host{--lr-icon-button-size:max(var(--lr-icon-button-size-scope,var(--lr-theme-icon-button-size,2.25rem)), 2.75rem)}}`,darkTokens=css` --lr-color-surface: var(--lr-theme-color-surface-default, #0a0a0a); --lr-color-surface-raised: var(--lr-theme-color-surface-raised, #171717); --lr-color-text: var(--lr-theme-color-text-normal, #fafafa); --_lr-glass-original-text-quiet: var(--_lr-preference-quiet-color, var(--lr-theme-color-text-quiet, #a1a1a1)); --_lr-glass-qualified-text-quiet: color-mix(in srgb, var(--_lr-preference-quiet-color, var(--lr-theme-color-text-quiet, #a1a1a1)), var(--lr-color-text) var(--_lr-glass-foreground-weight)); --lr-color-text-quiet: var(--_lr-glass-qualified-text-quiet, var(--_lr-preference-quiet-color, var(--lr-theme-color-text-quiet, #a1a1a1))); --_lr-glass-original-border: var(--_lr-preference-control-color, var(--lr-theme-color-surface-border, #646464)); --_lr-glass-qualified-border: color-mix(in srgb, var(--_lr-preference-control-color, var(--lr-theme-color-surface-border, #646464)), var(--lr-color-text) var(--_lr-glass-border-weight)); --lr-color-border: var(--_lr-glass-qualified-border, var(--_lr-preference-control-color, var(--lr-theme-color-surface-border, #646464))); --_lr-glass-original-border-strong: var(--_lr-preference-control-color, var(--lr-theme-color-border-strong, #646464)); --_lr-glass-qualified-border-strong: color-mix(in srgb, var(--_lr-preference-control-color, var(--lr-theme-color-border-strong, #646464)), var(--lr-color-text) var(--_lr-glass-border-weight)); --lr-color-border-strong: var(--_lr-glass-qualified-border-strong, var(--_lr-preference-control-color, var(--lr-theme-color-border-strong, #646464))); --lr-color-border-subtle: var(--_lr-preference-control-color, var(--lr-theme-color-surface-border-subtle, color-mix(in srgb, rgb(255 255 255 / 0.1) var(--_lr-subtle-mix,100%), var(--lr-color-border)))); --lr-color-surface-overlay: var(--lr-theme-color-surface-overlay, #171717); --lr-color-overlay: var(--lr-theme-color-overlay, rgb(0 0 0 / 0.72)); --lr-color-overlay-strong: var(--lr-theme-color-overlay-strong, rgb(0 0 0 / 0.95)); --lr-shadow-xs: var(--lr-theme-shadow-xs, 0 1px 2px 0 rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.15)); --lr-shadow-s: var(--lr-theme-shadow-s, 0 1px 3px 0 rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3), 0 1px 2px -1px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3)); --lr-shadow-m: var(--lr-theme-shadow-m, 0 4px 6px -1px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3), 0 2px 4px -2px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3)); --lr-shadow-l: var(--lr-theme-shadow-l, 0 10px 15px -3px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3), 0 4px 6px -4px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3)); --lr-shadow-xl: var(--lr-theme-shadow-xl, 0 20px 25px -5px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3), 0 8px 10px -6px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3)); `,auxTokens=css`@media (prefers-contrast:more){:host{--_lr-preference-quiet-color:currentColor;--_lr-preference-control-color:currentColor;--_lr-preference-focus-min:3px}}@media (prefers-reduced-motion:reduce){:host{--lr-duration-fast:.001ms;--lr-duration-base:.001ms;--lr-duration-ambient:.001ms;--lr-duration-icon:.001ms;--lr-easing-standard:linear;--lr-easing-emphasized:linear;--lr-transition-fast:.001ms linear;--lr-transition-base:.001ms linear;--lr-transition-ambient:.001ms linear}:host *,:host :before,:host :after{scroll-behavior:auto;animation-duration:.001ms;animation-iteration-count:1}}:host([hidden]){display:none!important}*,:before,:after{box-sizing:inherit}`,forcedColorTokens=css` --lr-color-surface: Canvas; --lr-color-surface-raised: Canvas; --lr-color-surface-container-lowest: Canvas; --lr-color-surface-container-low: Canvas; --lr-color-surface-container: Canvas; --lr-color-surface-container-high: Canvas; --lr-color-surface-container-highest: Canvas; --lr-color-text: CanvasText; --lr-color-text-quiet: CanvasText; --lr-color-border: ButtonText; --lr-color-border-subtle: ButtonText; --lr-color-brand: LinkText; --lr-color-brand-quiet: Canvas; --lr-color-success: LinkText; --lr-color-success-quiet: Canvas; --lr-color-warning: CanvasText; --lr-color-warning-quiet: Canvas; --lr-color-danger: LinkText; --lr-color-danger-quiet: Canvas; --lr-color-neutral: ButtonText; --lr-color-on-brand: Canvas; --lr-color-on-success: Canvas; --lr-color-on-warning: Canvas; --lr-color-on-danger: Canvas; --lr-color-on-neutral: Canvas; --lr-color-on-strong-overlay: CanvasText; --lr-focus-ring-color: Highlight; `,tokens=css` ${baseTokens} @media (prefers-color-scheme: dark) { :host(:not([data-lr-theme='light'])) {${darkTokens} } } :host([data-lr-theme='dark']) {${darkTokens} } :host(:not([data-lr-theme='light'])):host-context(.lr-dark), :host(:not([data-lr-theme='light'])):host-context([data-lr-theme='dark']) {${darkTokens} } ${auxTokens} @media (forced-colors: active) { :host, :host(:not([data-lr-theme='light'])), :host([data-lr-theme='dark']) {${forcedColorTokens} } :host(:not([data-lr-theme='light'])):host-context(.lr-dark), :host(:not([data-lr-theme='light'])):host-context([data-lr-theme='dark']) {${forcedColorTokens} } } `;export{tokens};
1
+ import{css}from"lit";const baseTokens=css`:host{--_lr-surface-default-blur:12px;--_lr-surface-default-maximum-blur:16px;--_lr-surface-default-highlight:#ffffff1f;--_lr-glass-dark-anchor:#000;--lr-color-surface:var(--lr-theme-color-surface-default,#fff);--lr-color-surface-raised:var(--lr-theme-color-surface-raised,#fafafa);--lr-color-surface-container-lowest:var(--lr-theme-color-surface-container-lowest,var(--lr-color-surface));--lr-color-surface-container-low:var(--lr-theme-color-surface-container-low,var(--lr-color-surface));--lr-color-surface-container:var(--lr-theme-color-surface-container,var(--lr-color-surface-raised));--lr-color-surface-container-high:var(--lr-theme-color-surface-container-high,var(--lr-color-surface-overlay));--lr-color-surface-container-highest:var(--lr-theme-color-surface-container-highest,var(--lr-color-surface-overlay));--lr-color-text:var(--lr-theme-color-text-normal,#0a0a0a);--_lr-glass-original-text-quiet:var(--_lr-preference-quiet-color,var(--lr-theme-color-text-quiet,#737373));--_lr-glass-qualified-text-quiet:color-mix(in srgb, var(--_lr-preference-quiet-color,var(--lr-theme-color-text-quiet,#737373)), var(--lr-color-text) var(--_lr-glass-foreground-weight));--lr-color-text-quiet:var(--_lr-glass-qualified-text-quiet,var(--_lr-preference-quiet-color,var(--lr-theme-color-text-quiet,#737373)));--_lr-glass-original-border:var(--_lr-preference-control-color,var(--lr-theme-color-surface-border,#919191));--_lr-glass-qualified-border:color-mix(in srgb, var(--_lr-preference-control-color,var(--lr-theme-color-surface-border,#919191)), var(--lr-color-text) var(--_lr-glass-border-weight));--lr-color-border:var(--_lr-glass-qualified-border,var(--_lr-preference-control-color,var(--lr-theme-color-surface-border,#919191)));--_lr-glass-original-border-strong:var(--_lr-preference-control-color,var(--lr-theme-color-border-strong,#919191));--_lr-glass-qualified-border-strong:color-mix(in srgb, var(--_lr-preference-control-color,var(--lr-theme-color-border-strong,#919191)), var(--lr-color-text) var(--_lr-glass-border-weight));--lr-color-border-strong:var(--_lr-glass-qualified-border-strong,var(--_lr-preference-control-color,var(--lr-theme-color-border-strong,#919191)));--lr-color-border-subtle:var(--_lr-preference-control-color,var(--lr-theme-color-surface-border-subtle,color-mix(in srgb, #e5e5e5 var(--_lr-subtle-mix,100%), var(--lr-color-border))));--_lr-glass-brand-text:color-mix(in srgb, var(--lr-color-brand), var(--lr-color-text) var(--_lr-glass-foreground-weight));--_lr-glass-danger-text:color-mix(in srgb, var(--lr-color-danger), var(--lr-color-text) var(--_lr-glass-foreground-weight));--lr-color-brand:var(--lr-color-brand-fill-loud);--lr-color-brand-quiet:var(--lr-color-brand-fill-quiet);--lr-color-success:var(--lr-color-success-fill-loud);--lr-color-success-quiet:var(--lr-color-success-fill-quiet);--lr-color-warning:var(--lr-color-warning-fill-loud);--lr-color-warning-quiet:var(--lr-color-warning-fill-quiet);--lr-color-danger:var(--lr-color-danger-fill-loud);--lr-color-danger-quiet:var(--lr-color-danger-fill-quiet);--lr-color-neutral:var(--lr-color-neutral-fill-loud);--lr-color-on-brand:var(--lr-color-brand-on-loud);--lr-color-on-success:var(--lr-color-success-on-loud);--lr-color-on-warning:var(--lr-color-warning-on-loud);--lr-color-on-danger:var(--lr-color-danger-on-loud);--lr-color-on-neutral:var(--lr-color-neutral-on-loud);--lr-color-on-strong-overlay:var(--lr-theme-color-on-strong-overlay,#fff);--lr-color-surface-overlay:var(--lr-theme-color-surface-overlay,#fff);--lr-color-overlay:var(--lr-theme-color-overlay,#00000080);--lr-color-overlay-strong:var(--lr-theme-color-overlay-strong,#000000eb);--lr-color-no-data:var(--lr-theme-color-no-data,#80808040);--lr-font-mono:var(--lr-theme-font-family-mono,"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);--lr-space-xs:var(--lr-theme-space-xs,.25rem);--lr-space-s:var(--lr-theme-space-s,.5rem);--lr-space-m:var(--lr-theme-space-m,.75rem);--lr-space-l:var(--lr-theme-space-l,1rem);--lr-space-2xs:var(--lr-theme-space-2xs,.125rem);--lr-space-2xl:var(--lr-theme-space-2xl,2rem);--lr-font-size-3xs:var(--lr-theme-font-size-3xs,.5rem);--lr-font-size-2xs:var(--lr-theme-font-size-2xs,.625rem);--lr-font-size-xs:var(--lr-theme-font-size-xs,.75rem);--lr-font-size-sm:var(--lr-theme-font-size-sm,.8125rem);--lr-font-size-m:var(--lr-theme-font-size-m,.875rem);--lr-font-size-md-sm:var(--lr-theme-font-size-md-sm,.875rem);--lr-font-size-lg:var(--lr-theme-font-size-lg,1.125rem);--lr-font-size-xl:var(--lr-theme-font-size-xl,1.25rem);--lr-font-size-2xl:var(--lr-theme-font-size-2xl,1.75rem);--lr-font-size-3xl:var(--lr-theme-font-size-3xl,2rem);--lr-font-weight-normal:var(--lr-theme-font-weight-normal,400);--lr-font-weight-medium:var(--lr-theme-font-weight-medium,500);--lr-font-weight-semibold:var(--lr-theme-font-weight-semibold,600);--lr-font-weight-bold:var(--lr-theme-font-weight-bold,700);--lr-line-height-none:var(--lr-theme-line-height-none,1);--lr-line-height-compact:var(--lr-theme-line-height-compact,1.25);--lr-line-height-snug:var(--lr-theme-line-height-snug,1.3);--lr-line-height-1-4:var(--lr-theme-line-height-1-4,1.4);--lr-line-height-normal:var(--lr-theme-line-height-normal,1.5);--lr-line-height-loose:var(--lr-theme-line-height-loose,1.6);--lr-line-break:var(--lr-theme-line-break,inherit);--lr-word-break:var(--lr-theme-word-break,inherit);--lr-border-width-thin:var(--lr-theme-border-width-thin,1px);--lr-border-width-medium:var(--lr-theme-border-width-medium,2px);--lr-border-width-thick:var(--lr-theme-border-width-thick,3px);--lr-radius-xs:var(--lr-theme-border-radius-xs,.25rem);--lr-radius-pill:var(--lr-theme-border-radius-pill,999px);--lr-color-shadow:var(--lr-theme-color-shadow,#000);--lr-mask-opaque:#000;--lr-layer-base:var(--lr-theme-z-index-base,0);--lr-layer-content:var(--lr-theme-z-index-content,1);--lr-layer-dropdown:var(--lr-theme-z-index-dropdown,900);--lr-layer-popover:var(--lr-theme-z-index-popover,1000);--lr-layer-modal:var(--lr-theme-z-index-modal,1000);--lr-layer-toast:var(--lr-theme-z-index-toast,9999);--lr-safe-area-top:env(safe-area-inset-top,0px);--lr-safe-area-bottom:env(safe-area-inset-bottom,0px);--lr-safe-area-inline-start:env(safe-area-inset-left,0px);--lr-safe-area-inline-end:env(safe-area-inset-right,0px);--lr-size-neg-0-15rem:var(--lr-theme-size-neg-0-15rem,-.15rem);--lr-size-neg-0-25rem:var(--lr-theme-size-neg-0-25rem,-.25rem);--lr-size-neg-1px:var(--lr-theme-size-neg-1px,-1px);--lr-size-neg-4px:var(--lr-theme-size-neg-4px,-4px);--lr-size-neg-6px:var(--lr-theme-size-neg-6px,-6px);--lr-size-neg-8px:var(--lr-theme-size-neg-8px,-8px);--lr-size-0-02em:var(--lr-theme-size-0-02em,.02em);--lr-size-0-03em:var(--lr-theme-size-0-03em,.03em);--lr-size-0-04em:var(--lr-theme-size-0-04em,.04em);--lr-size-0-05rem:var(--lr-theme-size-0-05rem,.05rem);--lr-size-0-0625rem:var(--lr-theme-size-0-0625rem,.0625rem);--lr-size-0-09375rem:var(--lr-theme-size-0-09375rem,.09375rem);--lr-size-0-125rem:var(--lr-theme-size-0-125rem,.125rem);--lr-size-0-15rem:var(--lr-theme-size-0-15rem,.15rem);--lr-size-0-1875rem:var(--lr-theme-size-0-1875rem,.1875rem);--lr-size-0-1rem:var(--lr-theme-size-0-1rem,.1rem);--lr-size-0-25rem:var(--lr-theme-size-0-25rem,.25rem);--lr-size-0-3125rem:var(--lr-theme-size-0-3125rem,.3125rem);--lr-size-0-35em:var(--lr-theme-size-0-35em,.35em);--lr-size-0-375rem:var(--lr-theme-size-0-375rem,.375rem);--lr-size-0-3em:var(--lr-theme-size-0-3em,.3em);--lr-size-0-4375rem:var(--lr-theme-size-0-4375rem,.4375rem);--lr-size-0-4em:var(--lr-theme-size-0-4em,.4em);--lr-size-0-4rem:var(--lr-theme-size-0-4rem,.4rem);--lr-size-0-5em:var(--lr-theme-size-0-5em,.5em);--lr-size-0-5rem:var(--lr-theme-size-0-5rem,.5rem);--lr-size-0-625rem:var(--lr-theme-size-0-625rem,.625rem);--lr-size-0-6875rem:var(--lr-theme-size-0-6875rem,.6875rem);--lr-size-0-6rem:var(--lr-theme-size-0-6rem,.6rem);--lr-size-0-75em:var(--lr-theme-size-0-75em,.75em);--lr-size-0-75rem:var(--lr-theme-size-0-75rem,.75rem);--lr-size-0-7em:var(--lr-theme-size-0-7em,.7em);--lr-size-0-875em:var(--lr-theme-size-0-875em,.875em);--lr-size-0-8rem:var(--lr-theme-size-0-8rem,.8rem);--lr-size-0-9375rem:var(--lr-theme-size-0-9375rem,.9375rem);--lr-size-1-0625rem:var(--lr-theme-size-1-0625rem,1.0625rem);--lr-size-1-1rem:var(--lr-theme-size-1-1rem,1.1rem);--lr-size-1-25rem:var(--lr-theme-size-1-25rem,1.25rem);--lr-size-1-5em:var(--lr-theme-size-1-5em,1.5em);--lr-size-1-5rem:var(--lr-theme-size-1-5rem,1.5rem);--lr-size-1-75rem:var(--lr-theme-size-1-75rem,1.75rem);--lr-size-1-875rem:var(--lr-theme-size-1-875rem,1.875rem);--lr-size-10px:var(--lr-theme-size-10px,10px);--lr-size-10rem:var(--lr-theme-size-10rem,10rem);--lr-size-12em:var(--lr-theme-size-12em,12em);--lr-size-12rem:var(--lr-theme-size-12rem,12rem);--lr-size-14px:var(--lr-theme-size-14px,14px);--lr-size-14rem:var(--lr-theme-size-14rem,14rem);--lr-size-15rem:var(--lr-theme-size-15rem,15rem);--lr-size-16px:var(--lr-theme-size-16px,16px);--lr-size-16rem:var(--lr-theme-size-16rem,16rem);--lr-size-18rem:var(--lr-theme-size-18rem,18rem);--lr-size-1em:var(--lr-theme-size-1em,1em);--lr-size-1px:var(--lr-theme-size-1px,1px);--lr-size-1rem:var(--lr-theme-size-1rem,1rem);--lr-size-2-25rem:var(--lr-theme-size-2-25rem,2.25rem);--lr-size-2-5rem:var(--lr-theme-size-2-5rem,2.5rem);--lr-size-2-5ch:var(--lr-theme-size-2-5ch,2.5ch);--lr-size-20rem:var(--lr-theme-size-20rem,20rem);--lr-size-22rem:var(--lr-theme-size-22rem,22rem);--lr-size-24px:var(--lr-theme-size-24px,24px);--lr-size-24rem:var(--lr-theme-size-24rem,24rem);--lr-size-280px:var(--lr-theme-size-280px,280px);--lr-size-28px:var(--lr-theme-size-28px,28px);--lr-size-28rem:var(--lr-theme-size-28rem,28rem);--lr-size-2px:var(--lr-theme-size-2px,2px);--lr-size-2rem:var(--lr-theme-size-2rem,2rem);--lr-size-3-5rem:var(--lr-theme-size-3-5rem,3.5rem);--lr-size-30rem:var(--lr-theme-size-30rem,30rem);--lr-size-32rem:var(--lr-theme-size-32rem,32rem);--lr-size-36rem:var(--lr-theme-size-36rem,36rem);--lr-size-38rem:var(--lr-theme-size-38rem,38rem);--lr-size-3px:var(--lr-theme-size-3px,3px);--lr-size-3rem:var(--lr-theme-size-3rem,3rem);--lr-scroll-fade-size:var(--lr-theme-scroll-fade-size,2rem);--lr-size-3ch:var(--lr-theme-size-3ch,3ch);--lr-size-3-5em:var(--lr-theme-size-3-5em,3.5em);--lr-size-48rem:var(--lr-theme-size-48rem,48rem);--lr-size-4px:var(--lr-theme-size-4px,4px);--lr-size-4rem:var(--lr-theme-size-4rem,4rem);--lr-size-4ch:var(--lr-theme-size-4ch,4ch);--lr-size-5em:var(--lr-theme-size-5em,5em);--lr-size-5rem:var(--lr-theme-size-5rem,5rem);--lr-size-6em:var(--lr-theme-size-6em,6em);--lr-size-6px:var(--lr-theme-size-6px,6px);--lr-size-6rem:var(--lr-theme-size-6rem,6rem);--lr-size-6ch:var(--lr-theme-size-6ch,6ch);--lr-size-7rem:var(--lr-theme-size-7rem,7rem);--lr-size-8em:var(--lr-theme-size-8em,8em);--lr-size-8rem:var(--lr-theme-size-8rem,8rem);--lr-radius:var(--lr-theme-border-radius-m,.5rem);--lr-radius-button:var(--lr-theme-border-radius-button,var(--lr-form-control-radius,var(--lr-radius)));--lr-radius-container:var(--lr-theme-border-radius-container,var(--lr-radius));--lr-table-row-min-height:var(--lr-theme-table-row-height,0px);--lr-shadow-color:var(--lr-theme-shadow-color,0 0 0);--lr-shadow-xs:var(--lr-theme-shadow-xs,0 1px 2px 0 rgb(var(--lr-theme-shadow-color,0 0 0) / .05));--lr-shadow-s:var(--lr-theme-shadow-s,0 1px 3px 0 rgb(var(--lr-theme-shadow-color,0 0 0) / .1), 0 1px 2px -1px rgb(var(--lr-theme-shadow-color,0 0 0) / .1));--lr-shadow-m:var(--lr-theme-shadow-m,0 4px 6px -1px rgb(var(--lr-theme-shadow-color,0 0 0) / .1), 0 2px 4px -2px rgb(var(--lr-theme-shadow-color,0 0 0) / .1));--lr-shadow-l:var(--lr-theme-shadow-l,0 10px 15px -3px rgb(var(--lr-theme-shadow-color,0 0 0) / .1), 0 4px 6px -4px rgb(var(--lr-theme-shadow-color,0 0 0) / .1));--lr-shadow-xl:var(--lr-theme-shadow-xl,0 20px 25px -5px rgb(var(--lr-theme-shadow-color,0 0 0) / .1), 0 8px 10px -6px rgb(var(--lr-theme-shadow-color,0 0 0) / .1));--lr-shadow:var(--lr-shadow-m);--lr-font:var(--lr-theme-font-family-body,"Geist", "Inter", ui-sans-serif, system-ui, sans-serif);--lr-font-heading:var(--lr-theme-font-family-heading,inherit);--lr-duration-fast:var(--_lr-motion-duration,var(--lr-theme-duration-fast,.12s));--lr-duration-base:var(--_lr-motion-duration,var(--lr-theme-duration-normal,.18s));--lr-duration-ambient:var(--_lr-motion-duration,var(--lr-theme-duration-slow,1.8s));--lr-duration-icon:var(--_lr-motion-duration,var(--lr-theme-duration-icon,1s));--lr-otp-input-segment-size:var(--lr-theme-otp-input-segment-size,2.5em);--lr-easing-standard:var(--_lr-motion-easing,var(--lr-theme-easing-standard,ease-out));--lr-easing-emphasized:var(--_lr-motion-easing,var(--lr-theme-easing-emphasized,ease-in-out));--lr-easing-linear:var(--lr-theme-easing-linear,linear);--lr-transition-fast:var(--_lr-motion-transition,var(--lr-theme-transition-fast,.12s ease-out));--lr-transition-base:var(--_lr-motion-transition,var(--lr-theme-transition-normal,.18s ease-out));--lr-transition-ambient:var(--_lr-motion-transition,var(--lr-theme-transition-slow,1.8s ease-in-out));--lr-transition-interactive:background-color var(--lr-transition-fast), color var(--lr-transition-fast), border-color var(--lr-transition-fast);--lr-opacity-disabled:var(--lr-theme-opacity-disabled,.5);--lr-opacity-muted:var(--lr-theme-opacity-muted,.85);--lr-color-mix-hover:var(--lr-theme-color-mix-hover,12%);--lr-color-mix-active:var(--lr-theme-color-mix-active,22%);--lr-color-mix-partner:var(--lr-theme-color-mix-partner,#737373);--lr-hover-brightness:var(--lr-theme-hover-brightness,1.08);--lr-popover-viewport-clamp:var(--lr-theme-popover-viewport-clamp,92vw);--lr-focus-ring-width:max(var(--lr-theme-focus-ring-width,3px), var(--_lr-preference-focus-min,0px));--_lr-glass-original-focus-ring-color:var(--lr-theme-color-focus,#1f7f5c);--_lr-glass-qualified-focus-ring-color:color-mix(in srgb, var(--lr-theme-color-focus,#1f7f5c), var(--lr-color-text) var(--_lr-glass-foreground-weight));--lr-focus-ring-color:var(--_lr-glass-qualified-focus-ring-color,var(--lr-theme-color-focus,#1f7f5c));--lr-focus-ring-offset:var(--lr-theme-focus-ring-offset,0px);--lr-focus-ring:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);--lr-icon-button-size:var(--lr-icon-button-size-scope,var(--lr-theme-icon-button-size,2.25rem));font-family:var(--lr-font);line-break:var(--lr-line-break);word-break:var(--lr-word-break);color:var(--lr-color-text);box-sizing:border-box}:where(h1,h2,h3,h4,h5,h6,[role=heading],[part~=heading]){font-family:var(--lr-font-heading)}:host(:dir(rtl)){--lr-safe-area-inline-start:env(safe-area-inset-right,0px);--lr-safe-area-inline-end:env(safe-area-inset-left,0px)}@media (hover:none),(pointer:coarse){:host{--lr-icon-button-size:max(var(--lr-icon-button-size-scope,var(--lr-theme-icon-button-size,2.25rem)), 2.75rem)}}`,darkTokens=css` --lr-color-surface: var(--lr-theme-color-surface-default, #0a0a0a); --lr-color-surface-raised: var(--lr-theme-color-surface-raised, #171717); --lr-color-text: var(--lr-theme-color-text-normal, #fafafa); --_lr-glass-original-text-quiet: var(--_lr-preference-quiet-color, var(--lr-theme-color-text-quiet, #a1a1a1)); --_lr-glass-qualified-text-quiet: color-mix(in srgb, var(--_lr-preference-quiet-color, var(--lr-theme-color-text-quiet, #a1a1a1)), var(--lr-color-text) var(--_lr-glass-foreground-weight)); --lr-color-text-quiet: var(--_lr-glass-qualified-text-quiet, var(--_lr-preference-quiet-color, var(--lr-theme-color-text-quiet, #a1a1a1))); --_lr-glass-original-border: var(--_lr-preference-control-color, var(--lr-theme-color-surface-border, #646464)); --_lr-glass-qualified-border: color-mix(in srgb, var(--_lr-preference-control-color, var(--lr-theme-color-surface-border, #646464)), var(--lr-color-text) var(--_lr-glass-border-weight)); --lr-color-border: var(--_lr-glass-qualified-border, var(--_lr-preference-control-color, var(--lr-theme-color-surface-border, #646464))); --_lr-glass-original-border-strong: var(--_lr-preference-control-color, var(--lr-theme-color-border-strong, #646464)); --_lr-glass-qualified-border-strong: color-mix(in srgb, var(--_lr-preference-control-color, var(--lr-theme-color-border-strong, #646464)), var(--lr-color-text) var(--_lr-glass-border-weight)); --lr-color-border-strong: var(--_lr-glass-qualified-border-strong, var(--_lr-preference-control-color, var(--lr-theme-color-border-strong, #646464))); --lr-color-border-subtle: var(--_lr-preference-control-color, var(--lr-theme-color-surface-border-subtle, color-mix(in srgb, rgb(255 255 255 / 0.1) var(--_lr-subtle-mix,100%), var(--lr-color-border)))); --lr-color-surface-overlay: var(--lr-theme-color-surface-overlay, #171717); --lr-color-overlay: var(--lr-theme-color-overlay, rgb(0 0 0 / 0.72)); --lr-color-overlay-strong: var(--lr-theme-color-overlay-strong, rgb(0 0 0 / 0.95)); --lr-shadow-xs: var(--lr-theme-shadow-xs, 0 1px 2px 0 rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.15)); --lr-shadow-s: var(--lr-theme-shadow-s, 0 1px 3px 0 rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3), 0 1px 2px -1px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3)); --lr-shadow-m: var(--lr-theme-shadow-m, 0 4px 6px -1px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3), 0 2px 4px -2px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3)); --lr-shadow-l: var(--lr-theme-shadow-l, 0 10px 15px -3px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3), 0 4px 6px -4px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3)); --lr-shadow-xl: var(--lr-theme-shadow-xl, 0 20px 25px -5px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3), 0 8px 10px -6px rgb(var(--lr-theme-shadow-color, 0 0 0) / 0.3)); `,auxTokens=css`@media (prefers-contrast:more){:host{--_lr-preference-quiet-color:currentColor;--_lr-preference-control-color:currentColor;--_lr-preference-focus-min:3px}}@media (prefers-reduced-motion:reduce){:host{--lr-duration-fast:.001ms;--lr-duration-base:.001ms;--lr-duration-ambient:.001ms;--lr-duration-icon:.001ms;--lr-easing-standard:linear;--lr-easing-emphasized:linear;--lr-transition-fast:.001ms linear;--lr-transition-base:.001ms linear;--lr-transition-ambient:.001ms linear}:host *,:host :before,:host :after{scroll-behavior:auto;animation-duration:.001ms;animation-iteration-count:1}}:host([hidden]){display:none!important}*,:before,:after{box-sizing:inherit}`,forcedColorTokens=css` --lr-color-surface: Canvas; --lr-color-surface-raised: Canvas; --lr-color-surface-container-lowest: Canvas; --lr-color-surface-container-low: Canvas; --lr-color-surface-container: Canvas; --lr-color-surface-container-high: Canvas; --lr-color-surface-container-highest: Canvas; --lr-color-text: CanvasText; --lr-color-text-quiet: CanvasText; --lr-color-border: ButtonText; --lr-color-border-subtle: ButtonText; --lr-color-brand: LinkText; --lr-color-brand-quiet: Canvas; --lr-color-success: LinkText; --lr-color-success-quiet: Canvas; --lr-color-warning: CanvasText; --lr-color-warning-quiet: Canvas; --lr-color-danger: LinkText; --lr-color-danger-quiet: Canvas; --lr-color-neutral: ButtonText; --lr-color-on-brand: Canvas; --lr-color-on-success: Canvas; --lr-color-on-warning: Canvas; --lr-color-on-danger: Canvas; --lr-color-on-neutral: Canvas; --lr-color-on-strong-overlay: CanvasText; --lr-focus-ring-color: Highlight; `,tokens=css` ${baseTokens} @media (prefers-color-scheme: dark) { :host(:not([data-lr-theme='light'])) {${darkTokens} } } :host([data-lr-theme='dark']) {${darkTokens} } :host(:not([data-lr-theme='light'])):host-context(.lr-dark), :host(:not([data-lr-theme='light'])):host-context([data-lr-theme='dark']) {${darkTokens} } ${auxTokens} @media (forced-colors: active) { :host, :host(:not([data-lr-theme='light'])), :host([data-lr-theme='dark']) {${forcedColorTokens} } :host(:not([data-lr-theme='light'])):host-context(.lr-dark), :host(:not([data-lr-theme='light'])):host-context([data-lr-theme='dark']) {${forcedColorTokens} } } `;export{tokens};
@@ -1 +1 @@
1
- @layer lr-base,lr-theme,lr-theme-preset,lr-utilities,lr-overrides,lr-theme-preset.look,lr-theme-preset.density;@layer lr-theme-preset.surface{:root{--lr-theme-surface-opacity:.7}:root,:host{--_lr-media-clear-scrim-start:.78;--_lr-media-clear-scrim-end:.92;--_lr-media-clear-fill:#ffffff14;--_lr-media-clear-text:#fff}[data-lr-surface=glass]{--_lr-surface-installed:1;--_lr-surface-enabled:1;--_lr-surface-root-filter:initial;--_lr-glass-blocker:initial;--_lr-surface-content:"";--_lr-surface-isolation:isolate;--_lr-surface-min-opacity:0;--_lr-surface-maximum-blur:16px;--_lr-surface-foreground-weight:99%;--_lr-surface-border-weight:285%;--_lr-surface-child-filter:none;--_lr-surface-child-opacity:1;--lr-theme-surface-blur:12px;--lr-theme-surface-saturation:1.1;--lr-theme-surface-highlight:#ffffff1f}[data-lr-surface=solid]{--_lr-surface-installed:1;--_lr-surface-enabled:0;--_lr-surface-root-filter:none;--_lr-glass-blocker:none;--_lr-surface-maximum-blur:initial;--_lr-surface-content:none;--_lr-surface-isolation:auto;--_lr-surface-child-filter:initial;--_lr-surface-child-opacity:0;--_lr-glass-parent-opacity:0;--_lr-next-glass-opacity:0}:where(.lr-surface-chrome){color:var(--lr-color-text);--_lr-surface-default-blur:12px;--_lr-surface-default-maximum-blur:16px;--_lr-surface-default-highlight:#ffffff1f;--lr-color-text:var(--lr-theme-color-text-normal,CanvasText);--_lr-glass-original-text-quiet:var(--_lr-preference-quiet-color,var(--lr-theme-color-text-quiet,CanvasText));--_lr-glass-original-border:var(--_lr-preference-control-color,var(--lr-theme-color-surface-border,CanvasText));--_lr-glass-original-border-strong:var(--_lr-preference-control-color,var(--lr-theme-color-border-strong,CanvasText));--_lr-glass-original-focus-ring-color:var(--lr-theme-color-focus,Highlight);--lr-focus-ring-width:max(var(--lr-theme-focus-ring-width,2px), var(--_lr-preference-focus-min,0px));--lr-focus-ring-color:var(--_lr-glass-qualified-focus-ring-color,var(--_lr-glass-original-focus-ring-color));--lr-focus-ring-offset:var(--lr-theme-focus-ring-offset,2px);--lr-focus-ring:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);position:relative}:where(.lr-surface-chrome)[data-lr-surface=solid]{--_lr-surface-enabled:0;--_lr-surface-root-filter:none;--_lr-surface-content:none;--_lr-surface-isolation:auto;--_lr-surface-child-filter:initial;--_lr-surface-child-opacity:0}:where(.lr-surface-chrome){background:var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas)));--_lr-glass-filter-value:blur(calc(clamp(0px, var(--lr-theme-surface-blur,var(--_lr-surface-default-blur)), var(--_lr-surface-maximum-blur,var(--_lr-surface-default-maximum-blur))) * (1 - var(--_lr-glass-parent-opacity,0)))) saturate(calc(1 + (clamp(0, var(--lr-theme-surface-saturation,1.1), 2) - 1) * (1 - var(--_lr-glass-parent-opacity,0))));--_lr-glass-current-filter:var(--_lr-preference-glass-filter,var(--_lr-glass-blocker,var(--_lr-glass-filter-value,none)));--_lr-glass-foreground-weight:initial;--_lr-glass-border-weight:initial;--_lr-next-glass-blocker:var(--_lr-surface-child-filter,none);--_lr-next-glass-opacity:var(--_lr-surface-child-opacity,1)}:where(.lr-surface-chrome[data-lr-surface=glass]){--_lr-next-glass-opacity:inherit}:where(.lr-surface-chrome[data-lr-surface=glass]>*){--_lr-next-glass-opacity:1}:where(.lr-surface-chrome>*){--_lr-glass-blocker:var(--_lr-next-glass-blocker,initial);--_lr-glass-parent-opacity:var(--_lr-next-glass-opacity,initial)}:where(.lr-surface-chrome)[data-lr-surface=solid],[data-lr-surface=solid]{--_lr-glass-parent-opacity:0;--_lr-next-glass-opacity:0;--_lr-glass-blocker:none}:where(.lr-surface-chrome)[data-lr-surface=glass],[data-lr-surface=glass]{--_lr-glass-blocker:initial}@supports (backdrop-filter:blur(0)){:where(.lr-surface-chrome){--_lr-glass-qualified-focus-ring-color:color-mix(in srgb, var(--_lr-glass-original-focus-ring-color,var(--lr-color-text)), var(--lr-color-text) calc(var(--_lr-surface-foreground-weight,99%) * var(--_lr-surface-enabled,1) * (1 - var(--_lr-glass-parent-opacity,0)) * (1 - var(--_lr-preference-glass-opacity,0))));isolation:var(--_lr-surface-isolation,isolate);--_lr-glass-effective-opacity:var(--_lr-preference-glass-opacity,max(var(--_lr-glass-parent-opacity,0), clamp(var(--_lr-surface-min-opacity,0), var(--lr-theme-surface-opacity,.7), 1)));--_lr-glass-border-weight:clamp(0%, calc(var(--_lr-surface-border-weight,285%) * var(--_lr-surface-enabled,1) * (1 - var(--_lr-glass-effective-opacity))), var(--_lr-surface-foreground-weight,99%));--_lr-glass-foreground-weight:calc(var(--_lr-surface-foreground-weight,99%) * var(--_lr-surface-enabled,1) * (1 - var(--_lr-glass-parent-opacity,0)) * (1 - var(--_lr-preference-glass-opacity,0)));--_lr-glass-qualified-text-quiet:color-mix(in srgb, var(--_lr-glass-original-text-quiet,var(--lr-color-text)), var(--lr-color-text) var(--_lr-glass-foreground-weight));--lr-color-text-quiet:var(--_lr-glass-qualified-text-quiet,var(--_lr-glass-original-text-quiet));--_lr-glass-qualified-border:color-mix(in srgb, var(--_lr-glass-original-border,var(--lr-color-text)), var(--lr-color-text) var(--_lr-glass-border-weight));--lr-color-border:var(--_lr-glass-qualified-border,var(--_lr-glass-original-border));--_lr-glass-qualified-border-strong:color-mix(in srgb, var(--_lr-glass-original-border-strong,var(--_lr-glass-original-border,var(--lr-color-text))), var(--lr-color-text) var(--_lr-glass-border-weight));--lr-color-border-strong:var(--_lr-glass-qualified-border-strong,var(--_lr-glass-original-border-strong));--_lr-glass-brand-text:color-mix(in srgb, var(--lr-color-brand), var(--lr-color-text) var(--_lr-glass-foreground-weight));--_lr-glass-danger-text:color-mix(in srgb, var(--lr-color-danger), var(--lr-color-text) var(--_lr-glass-foreground-weight));--_lr-glass-background:color-mix(in srgb, var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas))) calc((1 - var(--_lr-surface-enabled,1) * (1 - var(--_lr-preference-glass-opacity,0))) * 100%), color-mix(in srgb, var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas))) calc(var(--_lr-glass-effective-opacity) * 100%), transparent));background:var(--_lr-glass-background,var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas))))}:where(.lr-surface-chrome):before{content:var(--_lr-surface-content,"");z-index:-1;pointer-events:none;border-radius:inherit;block-size:auto;inline-size:auto;backdrop-filter:var(--_lr-glass-current-filter);box-shadow:inset 0 var(--lr-border-width-thin,1px) 0 var(--lr-theme-surface-highlight,var(--_lr-surface-default-highlight));position:absolute;inset:0}}@media (prefers-reduced-transparency:reduce),(prefers-contrast:more),(forced-colors:active){:where(.lr-surface-chrome){background:var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas)));--_lr-glass-foreground-weight:initial;--_lr-glass-border-weight:initial}:where(.lr-surface-chrome):before{content:none;backdrop-filter:none}}@media (forced-colors:active){:where(.lr-surface-chrome){background:canvas}}:where(.lr-surface-chrome):popover-open,:where(.lr-surface-chrome):modal{--_lr-glass-parent-opacity:initial!important;--_lr-glass-blocker:var(--_lr-surface-root-filter,initial)!important}}@layer lr-theme-preset.accent,lr-theme-preset.mode;
1
+ @layer lr-base,lr-theme,lr-theme-preset,lr-utilities,lr-overrides,lr-theme-preset.look,lr-theme-preset.density;@layer lr-theme-preset.surface{:root{--lr-theme-surface-opacity:.6}:root,:host{--_lr-media-clear-scrim-start:.78;--_lr-media-clear-scrim-end:.92;--_lr-media-clear-fill:#ffffff14;--_lr-media-clear-text:#fff;--_lr-glass-dark-anchor:#000}[data-lr-surface=glass]{--_lr-surface-installed:1;--_lr-surface-enabled:1;--_lr-surface-root-filter:initial;--_lr-glass-blocker:initial;--_lr-surface-content:"";--_lr-surface-isolation:isolate;--_lr-surface-min-opacity:0;--_lr-surface-maximum-blur:16px;--_lr-surface-foreground-weight:99%;--_lr-surface-border-weight:285%;--_lr-surface-child-filter:none;--_lr-surface-child-opacity:1;--lr-theme-surface-blur:12px;--lr-theme-surface-saturation:1.1;--lr-theme-surface-highlight:#ffffff1f}[data-lr-surface=solid]{--_lr-surface-installed:1;--_lr-surface-enabled:0;--_lr-surface-root-filter:none;--_lr-glass-blocker:none;--_lr-surface-maximum-blur:initial;--_lr-surface-content:none;--_lr-surface-isolation:auto;--_lr-surface-child-filter:initial;--_lr-surface-child-opacity:0;--_lr-glass-parent-opacity:0;--_lr-next-glass-opacity:0}:where(.lr-surface-chrome){color:var(--lr-color-text);--_lr-surface-default-blur:12px;--_lr-surface-default-maximum-blur:16px;--_lr-surface-default-highlight:#ffffff1f;--lr-color-text:var(--lr-theme-color-text-normal,CanvasText);--_lr-glass-original-text-quiet:var(--_lr-preference-quiet-color,var(--lr-theme-color-text-quiet,CanvasText));--_lr-glass-original-border:var(--_lr-preference-control-color,var(--lr-theme-color-surface-border,CanvasText));--_lr-glass-original-border-strong:var(--_lr-preference-control-color,var(--lr-theme-color-border-strong,CanvasText));--_lr-glass-original-focus-ring-color:var(--lr-theme-color-focus,Highlight);--lr-focus-ring-width:max(var(--lr-theme-focus-ring-width,2px), var(--_lr-preference-focus-min,0px));--lr-focus-ring-color:var(--_lr-glass-qualified-focus-ring-color,var(--_lr-glass-original-focus-ring-color));--lr-focus-ring-offset:var(--lr-theme-focus-ring-offset,2px);--lr-focus-ring:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);position:relative}:where(.lr-surface-chrome)[data-lr-surface=solid]{--_lr-surface-enabled:0;--_lr-surface-root-filter:none;--_lr-surface-content:none;--_lr-surface-isolation:auto;--_lr-surface-child-filter:initial;--_lr-surface-child-opacity:0}:where(.lr-surface-chrome){background:var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas)));--_lr-glass-filter-value:blur(calc(clamp(0px, var(--lr-theme-surface-blur,var(--_lr-surface-default-blur)), var(--_lr-surface-maximum-blur,var(--_lr-surface-default-maximum-blur))) * (1 - var(--_lr-glass-parent-opacity,0)))) saturate(calc(1 + (clamp(0, var(--lr-theme-surface-saturation,1.1), 2) - 1) * (1 - var(--_lr-glass-parent-opacity,0))));--_lr-glass-current-filter:var(--_lr-preference-glass-filter,var(--_lr-glass-blocker,var(--_lr-glass-filter-value,none)));--_lr-glass-foreground-weight:initial;--_lr-glass-border-weight:initial;--_lr-next-glass-blocker:var(--_lr-surface-child-filter,none);--_lr-next-glass-opacity:var(--_lr-surface-child-opacity,1)}:where(.lr-surface-chrome[data-lr-surface=glass]){--_lr-next-glass-opacity:inherit}:where(.lr-surface-chrome[data-lr-surface=glass]>*){--_lr-next-glass-opacity:1}:where(.lr-surface-chrome>*){--_lr-glass-blocker:var(--_lr-next-glass-blocker,initial);--_lr-glass-parent-opacity:var(--_lr-next-glass-opacity,initial)}:where(.lr-surface-chrome)[data-lr-surface=solid],[data-lr-surface=solid]{--_lr-glass-parent-opacity:0;--_lr-next-glass-opacity:0;--_lr-glass-blocker:none}:where(.lr-surface-chrome)[data-lr-surface=glass],[data-lr-surface=glass]{--_lr-glass-blocker:initial}@supports (backdrop-filter:blur(0)){:where(.lr-surface-chrome){--_lr-glass-qualified-focus-ring-color:color-mix(in srgb, var(--_lr-glass-original-focus-ring-color,var(--lr-color-text)), var(--lr-color-text) calc(var(--_lr-surface-foreground-weight,99%) * var(--_lr-surface-enabled,1) * (1 - var(--_lr-glass-parent-opacity,0)) * (1 - var(--_lr-preference-glass-opacity,0))));isolation:var(--_lr-surface-isolation,isolate);--_lr-glass-effective-opacity:var(--_lr-preference-glass-opacity,max(var(--_lr-glass-parent-opacity,0), clamp(var(--_lr-surface-min-opacity,0), var(--lr-theme-surface-opacity,.6), 1)));--_lr-glass-border-weight:clamp(0%, calc(var(--_lr-surface-border-weight,285%) * var(--_lr-surface-enabled,1) * (1 - var(--_lr-glass-effective-opacity))), var(--_lr-surface-foreground-weight,99%));--_lr-glass-foreground-weight:calc(var(--_lr-surface-foreground-weight,99%) * var(--_lr-surface-enabled,1) * (1 - var(--_lr-glass-parent-opacity,0)) * (1 - var(--_lr-preference-glass-opacity,0)));--_lr-glass-qualified-text-quiet:color-mix(in srgb, var(--_lr-glass-original-text-quiet,var(--lr-color-text)), var(--lr-color-text) var(--_lr-glass-foreground-weight));--lr-color-text-quiet:var(--_lr-glass-qualified-text-quiet,var(--_lr-glass-original-text-quiet));--_lr-glass-qualified-border:color-mix(in srgb, var(--_lr-glass-original-border,var(--lr-color-text)), var(--lr-color-text) var(--_lr-glass-border-weight));--lr-color-border:var(--_lr-glass-qualified-border,var(--_lr-glass-original-border));--_lr-glass-qualified-border-strong:color-mix(in srgb, var(--_lr-glass-original-border-strong,var(--_lr-glass-original-border,var(--lr-color-text))), var(--lr-color-text) var(--_lr-glass-border-weight));--lr-color-border-strong:var(--_lr-glass-qualified-border-strong,var(--_lr-glass-original-border-strong));--_lr-glass-brand-text:color-mix(in srgb, var(--lr-color-brand), var(--lr-color-text) var(--_lr-glass-foreground-weight));--_lr-glass-danger-text:color-mix(in srgb, var(--lr-color-danger), var(--lr-color-text) var(--_lr-glass-foreground-weight));--_lr-glass-dark-fill-weight:clamp(20%, calc(var(--_lr-glass-effective-opacity) * 800% - 460%), 100%);--_lr-glass-fill:light-dark(var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas))),color-mix(in srgb, var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas))) var(--_lr-glass-dark-fill-weight), var(--_lr-glass-dark-anchor)));--_lr-glass-background:color-mix(in srgb, var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas))) calc((1 - var(--_lr-surface-enabled,1) * (1 - var(--_lr-preference-glass-opacity,0))) * 100%), color-mix(in srgb, var(--_lr-glass-fill) calc(var(--_lr-glass-effective-opacity) * 100%), transparent));background:var(--_lr-glass-background,var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas))))}:where(.lr-surface-chrome):before{content:var(--_lr-surface-content,"");z-index:-1;pointer-events:none;border-radius:inherit;block-size:auto;inline-size:auto;backdrop-filter:var(--_lr-glass-current-filter);box-shadow:inset 0 var(--lr-border-width-thin,1px) 0 var(--lr-theme-surface-highlight,var(--_lr-surface-default-highlight));position:absolute;inset:0}}@media (prefers-reduced-transparency:reduce),(prefers-contrast:more),(forced-colors:active){:where(.lr-surface-chrome){background:var(--lr-surface-background,var(--lr-theme-color-surface-container-high,var(--lr-theme-color-surface-overlay,Canvas)));--_lr-glass-foreground-weight:initial;--_lr-glass-border-weight:initial}:where(.lr-surface-chrome):before{content:none;backdrop-filter:none}}@media (forced-colors:active){:where(.lr-surface-chrome){background:canvas}}:where(.lr-surface-chrome):popover-open,:where(.lr-surface-chrome):modal{--_lr-glass-parent-opacity:initial!important;--_lr-glass-blocker:var(--_lr-surface-root-filter,initial)!important}}@layer lr-theme-preset.accent,lr-theme-preset.mode;