@justeattakeaway/pie-button 0.45.0 → 0.45.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.
Files changed (3) hide show
  1. package/dist/index.js +550 -547
  2. package/package.json +5 -5
  3. package/src/react.ts +2 -3
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { LitElement as wt, html as N, nothing as W, unsafeCSS as xt } from "lit";
2
- import { property as h } from "lit/decorators.js";
3
- import { ifDefined as Et } from "lit/directives/if-defined.js";
4
- import { FormControlMixin as kt, validPropertyValues as R, defineCustomElement as zt } from "@justeattakeaway/pie-webc-core";
1
+ import { LitElement as zt, html as N, nothing as B, unsafeCSS as Ct } from "lit";
2
+ import { property as m } from "lit/decorators.js";
3
+ import { ifDefined as St } from "lit/directives/if-defined.js";
4
+ import { FormControlMixin as Ft, validPropertyValues as P, defineCustomElement as Lt } from "@justeattakeaway/pie-webc-core";
5
5
  import "@justeattakeaway/pie-spinner";
6
- const Mt = ["xsmall", "small-productive", "small-expressive", "medium", "large"], Pt = ["productive", "expressive"], Ct = ["submit", "button", "reset"], Lt = [
6
+ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"], Bt = ["productive", "expressive"], It = ["submit", "button", "reset"], Tt = [
7
7
  "primary",
8
8
  "secondary",
9
9
  "outline",
@@ -13,513 +13,516 @@ const Mt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
13
13
  "ghost-inverse",
14
14
  "destructive",
15
15
  "destructive-ghost"
16
- ], Ft = ["leading", "trailing"], Dt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], $t = ["post", "get", "dialog"], Ot = ["_self", "_blank", "_parent", "_top"], St = `*,*:before,*:after{box-sizing:border-box}.o-btn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-m-family);--btn-font-weight: var(--dt-font-interactive-m-weight);--btn-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-primary);--btn-height--xsmall: 32px;--btn-height--small: 40px;--btn-height--medium: 48px;--btn-height--large: 56px;--icon-display-override: block;position:relative;display:flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;box-sizing:border-box;height:var(--btn-height);padding:var(--btn-padding);border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-bg-color);font-family:var(--btn-font-family);font-size:var(--btn-font-size);font-weight:var(--btn-font-weight);color:var(--btn-text-color);line-height:var(--btn-line-height);cursor:pointer;user-select:none;inline-size:var(--btn-inline-size)}.o-btn[variant=primary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.o-btn[variant=primary]:active:not(:disabled),.o-btn[variant=primary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}.o-btn[variant=primary][size=xsmall],.o-btn[variant=primary][size=small-productive]{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn[variant=primary][size=xsmall]:hover:not(:disabled),.o-btn[variant=primary][size=small-productive]:hover:not(:disabled){--hover-modifier: var(--dt-color-hover-02);--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--hover-modifier)))}.o-btn[variant=primary][size=xsmall]:active:not(:disabled),.o-btn[variant=primary][size=xsmall][isLoading]:not(:disabled),.o-btn[variant=primary][size=small-productive]:active:not(:disabled),.o-btn[variant=primary][size=small-productive][isLoading]:not(:disabled){--active-modifier: var(--dt-color-active-02);--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--active-modifier)))}.o-btn[variant=secondary]{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=secondary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--hover-modifier)))}.o-btn[variant=secondary]:active:not(:disabled),.o-btn[variant=secondary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--active-modifier)))}.o-btn[variant=outline]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary);border:1px solid var(--dt-color-border-strong)}.o-btn[variant=outline]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=outline]:active:not(:disabled),.o-btn[variant=outline][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link)}.o-btn[variant=ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=ghost]:active:not(:disabled),.o-btn[variant=ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=inverse]{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--hover-modifier)))}.o-btn[variant=inverse]:active:not(:disabled),.o-btn[variant=inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--active-modifier)))}.o-btn[variant=ghost-inverse],.o-btn[variant=outline-inverse]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn[variant=ghost-inverse]:hover:not(:disabled),.o-btn[variant=outline-inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--hover-modifier))}.o-btn[variant=ghost-inverse]:active:not(:disabled),.o-btn[variant=ghost-inverse][isLoading]:not(:disabled),.o-btn[variant=outline-inverse]:active:not(:disabled),.o-btn[variant=outline-inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--active-modifier))}.o-btn[variant=outline-inverse]:not([disabled]){border:1px solid var(--dt-color-border-strong)}.o-btn[variant=destructive]{--btn-bg-color: var(--dt-color-support-error)}.o-btn[variant=destructive]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--hover-modifier)))}.o-btn[variant=destructive]:active:not(:disabled),.o-btn[variant=destructive][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--active-modifier)))}.o-btn[variant=destructive-ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error)}.o-btn[variant=destructive-ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=destructive-ghost]:active:not(:disabled),.o-btn[variant=destructive-ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[isFullWidth]{--btn-inline-size: 100%}.o-btn[disabled]{--btn-text-color: var(--dt-color-content-disabled) !important;cursor:not-allowed}.o-btn[disabled]:not([variant=ghost],[variant=ghost-inverse],[variant=destructive-ghost]){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled][variant=outline]{border-color:var(--dt-color-disabled-01)!important}.o-btn[size=xsmall]{--btn-height: var(--btn-height--xsmall);--btn-padding: 6px var(--dt-spacing-b);--btn-font-size: calc(var(--dt-font-size-14) * 1px);--btn-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--icon-size-override: 16px}@media (min-width: 768px){.o-btn[size=xsmall][isResponsive]{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px}.o-btn[size=xsmall][isResponsive][responsiveSize=expressive]{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px}}.o-btn[size=small-expressive]{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px}@media (min-width: 768px){.o-btn[size=small-expressive][isResponsive]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=small-productive]{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px}@media (min-width: 768px){.o-btn[size=small-productive][isResponsive]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=medium]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}@media (min-width: 768px){.o-btn[size=medium][isResponsive]{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=large]{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}.o-btn[isLoading]>*:not(pie-spinner){visibility:hidden}.o-btn[isLoading] pie-spinner{position:absolute}.o-btn:focus-visible{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}::slotted(svg){height:var(--icon-size-override);width:var(--icon-size-override)}
16
+ ], Vt = ["leading", "trailing"], Kt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], Ut = ["post", "get", "dialog"], qt = ["_self", "_blank", "_parent", "_top"], Nt = `*,*:before,*:after{box-sizing:border-box}.o-btn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-m-family);--btn-font-weight: var(--dt-font-interactive-m-weight);--btn-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-primary);--btn-height--xsmall: 32px;--btn-height--small: 40px;--btn-height--medium: 48px;--btn-height--large: 56px;--icon-display-override: block;position:relative;display:flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;box-sizing:border-box;height:var(--btn-height);padding:var(--btn-padding);border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-bg-color);font-family:var(--btn-font-family);font-size:var(--btn-font-size);font-weight:var(--btn-font-weight);color:var(--btn-text-color);line-height:var(--btn-line-height);cursor:pointer;user-select:none;inline-size:var(--btn-inline-size)}.o-btn[variant=primary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.o-btn[variant=primary]:active:not(:disabled),.o-btn[variant=primary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}.o-btn[variant=primary][size=xsmall],.o-btn[variant=primary][size=small-productive]{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn[variant=primary][size=xsmall]:hover:not(:disabled),.o-btn[variant=primary][size=small-productive]:hover:not(:disabled){--hover-modifier: var(--dt-color-hover-02);--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--hover-modifier)))}.o-btn[variant=primary][size=xsmall]:active:not(:disabled),.o-btn[variant=primary][size=xsmall][isLoading]:not(:disabled),.o-btn[variant=primary][size=small-productive]:active:not(:disabled),.o-btn[variant=primary][size=small-productive][isLoading]:not(:disabled){--active-modifier: var(--dt-color-active-02);--btn-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--active-modifier)))}.o-btn[variant=secondary]{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=secondary]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--hover-modifier)))}.o-btn[variant=secondary]:active:not(:disabled),.o-btn[variant=secondary][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--active-modifier)))}.o-btn[variant=outline]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary);border:1px solid var(--dt-color-border-strong)}.o-btn[variant=outline]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=outline]:active:not(:disabled),.o-btn[variant=outline][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link)}.o-btn[variant=ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=ghost]:active:not(:disabled),.o-btn[variant=ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[variant=inverse]{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--hover-modifier)))}.o-btn[variant=inverse]:active:not(:disabled),.o-btn[variant=inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--active-modifier)))}.o-btn[variant=ghost-inverse],.o-btn[variant=outline-inverse]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn[variant=ghost-inverse]:hover:not(:disabled),.o-btn[variant=outline-inverse]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--hover-modifier))}.o-btn[variant=ghost-inverse]:active:not(:disabled),.o-btn[variant=ghost-inverse][isLoading]:not(:disabled),.o-btn[variant=outline-inverse]:active:not(:disabled),.o-btn[variant=outline-inverse][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--active-modifier))}.o-btn[variant=outline-inverse]:not([disabled]){border:1px solid var(--dt-color-border-strong)}.o-btn[variant=destructive]{--btn-bg-color: var(--dt-color-support-error)}.o-btn[variant=destructive]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--hover-modifier)))}.o-btn[variant=destructive]:active:not(:disabled),.o-btn[variant=destructive][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--active-modifier)))}.o-btn[variant=destructive-ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error)}.o-btn[variant=destructive-ghost]:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn[variant=destructive-ghost]:active:not(:disabled),.o-btn[variant=destructive-ghost][isLoading]:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn[isFullWidth]{--btn-inline-size: 100%}.o-btn[disabled]{--btn-text-color: var(--dt-color-content-disabled) !important;cursor:not-allowed}.o-btn[disabled]:not([variant=ghost],[variant=ghost-inverse],[variant=destructive-ghost]){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled][variant=outline]{border-color:var(--dt-color-disabled-01)!important}.o-btn[size=xsmall]{--btn-height: var(--btn-height--xsmall);--btn-padding: 6px var(--dt-spacing-b);--btn-font-size: calc(var(--dt-font-size-14) * 1px);--btn-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--icon-size-override: 16px}@media (min-width: 768px){.o-btn[size=xsmall][isResponsive]{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px}.o-btn[size=xsmall][isResponsive][responsiveSize=expressive]{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px}}.o-btn[size=small-expressive]{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px}@media (min-width: 768px){.o-btn[size=small-expressive][isResponsive]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=small-productive]{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--btn-font-size: calc(var(--dt-font-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px}@media (min-width: 768px){.o-btn[size=small-productive][isResponsive]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=medium]{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}@media (min-width: 768px){.o-btn[size=medium][isResponsive]{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}}.o-btn[size=large]{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 24px}.o-btn[isLoading]>*:not(pie-spinner){visibility:hidden}.o-btn[isLoading] pie-spinner{position:absolute}.o-btn:focus-visible{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}::slotted(svg){height:var(--icon-size-override);width:var(--icon-size-override)}
17
17
  `;
18
18
  (function() {
19
- const p = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), S = {
20
- ariaAtomic: "aria-atomic",
21
- ariaAutoComplete: "aria-autocomplete",
22
- ariaBusy: "aria-busy",
23
- ariaChecked: "aria-checked",
24
- ariaColCount: "aria-colcount",
25
- ariaColIndex: "aria-colindex",
26
- ariaColIndexText: "aria-colindextext",
27
- ariaColSpan: "aria-colspan",
28
- ariaCurrent: "aria-current",
29
- ariaDisabled: "aria-disabled",
30
- ariaExpanded: "aria-expanded",
31
- ariaHasPopup: "aria-haspopup",
32
- ariaHidden: "aria-hidden",
33
- ariaInvalid: "aria-invalid",
34
- ariaKeyShortcuts: "aria-keyshortcuts",
35
- ariaLabel: "aria-label",
36
- ariaLevel: "aria-level",
37
- ariaLive: "aria-live",
38
- ariaModal: "aria-modal",
39
- ariaMultiLine: "aria-multiline",
40
- ariaMultiSelectable: "aria-multiselectable",
41
- ariaOrientation: "aria-orientation",
42
- ariaPlaceholder: "aria-placeholder",
43
- ariaPosInSet: "aria-posinset",
44
- ariaPressed: "aria-pressed",
45
- ariaReadOnly: "aria-readonly",
46
- ariaRelevant: "aria-relevant",
47
- ariaRequired: "aria-required",
48
- ariaRoleDescription: "aria-roledescription",
49
- ariaRowCount: "aria-rowcount",
50
- ariaRowIndex: "aria-rowindex",
51
- ariaRowIndexText: "aria-rowindextext",
52
- ariaRowSpan: "aria-rowspan",
53
- ariaSelected: "aria-selected",
54
- ariaSetSize: "aria-setsize",
55
- ariaSort: "aria-sort",
56
- ariaValueMax: "aria-valuemax",
57
- ariaValueMin: "aria-valuemin",
58
- ariaValueNow: "aria-valuenow",
59
- ariaValueText: "aria-valuetext",
60
- role: "role"
61
- }, ot = (i, t) => {
62
- for (let e in S) {
63
- t[e] = null;
64
- let r = null;
65
- const o = S[e];
66
- Object.defineProperty(t, e, {
67
- get() {
68
- return r;
69
- },
70
- set(l) {
71
- r = l, i.isConnected ? i.setAttribute(o, l) : k.set(i, t);
19
+ (function(E) {
20
+ const a = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), A = {
21
+ ariaAtomic: "aria-atomic",
22
+ ariaAutoComplete: "aria-autocomplete",
23
+ ariaBusy: "aria-busy",
24
+ ariaChecked: "aria-checked",
25
+ ariaColCount: "aria-colcount",
26
+ ariaColIndex: "aria-colindex",
27
+ ariaColIndexText: "aria-colindextext",
28
+ ariaColSpan: "aria-colspan",
29
+ ariaCurrent: "aria-current",
30
+ ariaDisabled: "aria-disabled",
31
+ ariaExpanded: "aria-expanded",
32
+ ariaHasPopup: "aria-haspopup",
33
+ ariaHidden: "aria-hidden",
34
+ ariaInvalid: "aria-invalid",
35
+ ariaKeyShortcuts: "aria-keyshortcuts",
36
+ ariaLabel: "aria-label",
37
+ ariaLevel: "aria-level",
38
+ ariaLive: "aria-live",
39
+ ariaModal: "aria-modal",
40
+ ariaMultiLine: "aria-multiline",
41
+ ariaMultiSelectable: "aria-multiselectable",
42
+ ariaOrientation: "aria-orientation",
43
+ ariaPlaceholder: "aria-placeholder",
44
+ ariaPosInSet: "aria-posinset",
45
+ ariaPressed: "aria-pressed",
46
+ ariaReadOnly: "aria-readonly",
47
+ ariaRelevant: "aria-relevant",
48
+ ariaRequired: "aria-required",
49
+ ariaRoleDescription: "aria-roledescription",
50
+ ariaRowCount: "aria-rowcount",
51
+ ariaRowIndex: "aria-rowindex",
52
+ ariaRowIndexText: "aria-rowindextext",
53
+ ariaRowSpan: "aria-rowspan",
54
+ ariaSelected: "aria-selected",
55
+ ariaSetSize: "aria-setsize",
56
+ ariaSort: "aria-sort",
57
+ ariaValueMax: "aria-valuemax",
58
+ ariaValueMin: "aria-valuemin",
59
+ ariaValueNow: "aria-valuenow",
60
+ ariaValueText: "aria-valuetext",
61
+ role: "role"
62
+ }, ct = (e, t) => {
63
+ for (let i in A) {
64
+ t[i] = null;
65
+ let r = null;
66
+ const o = A[i];
67
+ Object.defineProperty(t, i, {
68
+ get() {
69
+ return r;
70
+ },
71
+ set(s) {
72
+ r = s, e.isConnected ? e.setAttribute(o, s) : F.set(e, t);
73
+ }
74
+ });
75
+ }
76
+ };
77
+ function G(e) {
78
+ const t = c.get(e), { form: i } = t;
79
+ tt(e, i, t), Z(e, t.labels);
80
+ }
81
+ const J = (e, t = !1) => {
82
+ const i = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
83
+ acceptNode(s) {
84
+ return c.has(s) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
72
85
  }
73
86
  });
74
- }
75
- };
76
- function U(i) {
77
- const t = c.get(i), { form: e } = t;
78
- Y(i, e, t), X(i, t.labels);
79
- }
80
- const j = (i, t = !1) => {
81
- const e = document.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, {
82
- acceptNode(l) {
83
- return c.has(l) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
84
- }
85
- });
86
- let r = e.nextNode();
87
- const o = !t || i.disabled;
88
- for (; r; )
89
- r.formDisabledCallback && o && D(r, i.disabled), r = e.nextNode();
90
- }, G = { attributes: !0, attributeFilter: ["disabled", "name"] }, z = I() ? new MutationObserver((i) => {
91
- for (const t of i) {
92
- const e = t.target;
93
- if (t.attributeName === "disabled" && (e.constructor.formAssociated ? D(e, e.hasAttribute("disabled")) : e.localName === "fieldset" && j(e)), t.attributeName === "name" && e.constructor.formAssociated) {
94
- const r = c.get(e), o = M.get(e);
95
- r.setFormValue(o);
87
+ let r = i.nextNode();
88
+ const o = !t || e.disabled;
89
+ for (; r; )
90
+ r.formDisabledCallback && o && D(r, e.disabled), r = i.nextNode();
91
+ }, Q = { attributes: !0, attributeFilter: ["disabled", "name"] }, k = V() ? new MutationObserver((e) => {
92
+ for (const t of e) {
93
+ const i = t.target;
94
+ if (t.attributeName === "disabled" && (i.constructor.formAssociated ? D(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && J(i)), t.attributeName === "name" && i.constructor.formAssociated) {
95
+ const r = c.get(i), o = S.get(i);
96
+ r.setFormValue(o);
97
+ }
96
98
  }
99
+ }) : {};
100
+ function R(e) {
101
+ e.forEach((t) => {
102
+ const { addedNodes: i, removedNodes: r } = t, o = Array.from(i), s = Array.from(r);
103
+ o.forEach((l) => {
104
+ var u;
105
+ if (c.has(l) && l.constructor.formAssociated && G(l), F.has(l)) {
106
+ const d = F.get(l);
107
+ Object.keys(A).filter((g) => d[g] !== null).forEach((g) => {
108
+ l.setAttribute(A[g], d[g]);
109
+ }), F.delete(l);
110
+ }
111
+ if (L.has(l)) {
112
+ const d = L.get(l);
113
+ l.setAttribute("internals-valid", d.validity.valid.toString()), l.setAttribute("internals-invalid", (!d.validity.valid).toString()), l.setAttribute("aria-invalid", (!d.validity.valid).toString()), L.delete(l);
114
+ }
115
+ if (l.localName === "form") {
116
+ const d = b.get(l), x = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, {
117
+ acceptNode(H) {
118
+ return c.has(H) && H.constructor.formAssociated && !(d && d.has(H)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
119
+ }
120
+ });
121
+ let g = x.nextNode();
122
+ for (; g; )
123
+ G(g), g = x.nextNode();
124
+ }
125
+ l.localName === "fieldset" && ((u = k.observe) == null || u.call(k, l, Q), J(l, !0));
126
+ }), s.forEach((l) => {
127
+ const u = c.get(l);
128
+ u && h.get(u) && X(u), M.has(l) && M.get(l).disconnect();
129
+ });
130
+ });
97
131
  }
98
- }) : {};
99
- function _(i) {
100
- i.forEach((t) => {
101
- const { addedNodes: e, removedNodes: r } = t, o = Array.from(e), l = Array.from(r);
102
- o.forEach((n) => {
103
- var b;
104
- if (c.has(n) && n.constructor.formAssociated && U(n), k.has(n)) {
105
- const d = k.get(n);
106
- Object.keys(S).filter((w) => d[w] !== null).forEach((w) => {
107
- n.setAttribute(S[w], d[w]);
108
- }), k.delete(n);
109
- }
110
- if (F.has(n)) {
111
- const d = F.get(n);
112
- n.setAttribute("internals-valid", d.validity.valid.toString()), n.setAttribute("internals-invalid", (!d.validity.valid).toString()), n.setAttribute("aria-invalid", (!d.validity.valid).toString()), F.delete(n);
113
- }
114
- if (n.localName === "form") {
115
- const d = y.get(n), E = document.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, {
116
- acceptNode(O) {
117
- return c.has(O) && O.constructor.formAssociated && !(d && d.has(O)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
118
- }
119
- });
120
- let w = E.nextNode();
121
- for (; w; )
122
- U(w), w = E.nextNode();
132
+ function dt(e) {
133
+ e.forEach((t) => {
134
+ const { removedNodes: i } = t;
135
+ i.forEach((r) => {
136
+ const o = q.get(t.target);
137
+ c.has(r) && it(r), o.disconnect();
138
+ });
139
+ });
140
+ }
141
+ const vt = (e) => {
142
+ var i, r;
143
+ const t = new MutationObserver(dt);
144
+ (i = window == null ? void 0 : window.ShadyDOM) != null && i.inUse && e.mode && e.host && (e = e.host), (r = t.observe) == null || r.call(t, e, { childList: !0 }), q.set(e, t);
145
+ };
146
+ V() && new MutationObserver(R);
147
+ const _ = {
148
+ childList: !0,
149
+ subtree: !0
150
+ }, D = (e, t) => {
151
+ e.toggleAttribute("internals-disabled", t), t ? e.setAttribute("aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
152
+ }, X = (e) => {
153
+ h.get(e).forEach((i) => {
154
+ i.remove();
155
+ }), h.set(e, []);
156
+ }, Y = (e, t) => {
157
+ const i = document.createElement("input");
158
+ return i.type = "hidden", i.name = e.getAttribute("name"), e.after(i), h.get(t).push(i), i;
159
+ }, ht = (e, t) => {
160
+ var i;
161
+ h.set(t, []), (i = k.observe) == null || i.call(k, e, Q);
162
+ }, Z = (e, t) => {
163
+ if (t.length) {
164
+ Array.from(t).forEach((r) => r.addEventListener("click", e.click.bind(e)));
165
+ let i = t[0].id;
166
+ t[0].id || (i = `${t[0].htmlFor}_Label`, t[0].id = i), e.setAttribute("aria-labelledby", i);
167
+ }
168
+ }, I = (e) => {
169
+ const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), i = b.get(e) || [], r = Array.from(i).filter((s) => s.isConnected).map((s) => c.get(s).validity.valid), o = [...t, ...r].includes(!1);
170
+ e.toggleAttribute("internals-invalid", o), e.toggleAttribute("internals-valid", !o);
171
+ }, mt = (e) => {
172
+ I(T(e.target));
173
+ }, pt = (e) => {
174
+ I(T(e.target));
175
+ }, ut = (e) => {
176
+ const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${e.id ? `,${i}[form='${e.id}']` : ""}`).join(",");
177
+ e.addEventListener("click", (i) => {
178
+ if (i.target.closest(t)) {
179
+ const o = b.get(e);
180
+ if (e.noValidate)
181
+ return;
182
+ o.size && Array.from(o).reverse().map((u) => c.get(u).reportValidity()).includes(!1) && i.preventDefault();
123
183
  }
124
- n.localName === "fieldset" && ((b = z.observe) == null || b.call(z, n, G), j(n, !0));
125
- }), l.forEach((n) => {
126
- const b = c.get(n);
127
- b && a.get(b) && J(b), g.has(n) && g.get(n).disconnect();
128
184
  });
129
- });
130
- }
131
- function at(i) {
132
- i.forEach((t) => {
133
- const { removedNodes: e } = t;
134
- e.forEach((r) => {
135
- const o = K.get(t.target);
136
- c.has(r) && tt(r), o.disconnect();
185
+ }, ft = (e) => {
186
+ const t = b.get(e.target);
187
+ t && t.size && t.forEach((i) => {
188
+ i.constructor.formAssociated && i.formResetCallback && i.formResetCallback.apply(i);
137
189
  });
138
- });
139
- }
140
- const nt = (i) => {
141
- var e;
142
- const t = new MutationObserver(at);
143
- (e = t.observe) == null || e.call(t, i, { childList: !0 }), K.set(i, t);
144
- };
145
- I() && new MutationObserver(_);
146
- const P = {
147
- childList: !0,
148
- subtree: !0
149
- }, D = (i, t) => {
150
- i.toggleAttribute("internals-disabled", t), t ? i.setAttribute("aria-disabled", "true") : i.removeAttribute("aria-disabled"), i.formDisabledCallback && i.formDisabledCallback.apply(i, [t]);
151
- }, J = (i) => {
152
- a.get(i).forEach((e) => {
153
- e.remove();
154
- }), a.set(i, []);
155
- }, Q = (i, t) => {
156
- const e = document.createElement("input");
157
- return e.type = "hidden", e.name = i.getAttribute("name"), i.after(e), a.get(t).push(e), e;
158
- }, st = (i, t) => {
159
- var e;
160
- a.set(t, []), (e = z.observe) == null || e.call(z, i, G);
161
- }, X = (i, t) => {
162
- if (t.length) {
163
- Array.from(t).forEach((r) => r.addEventListener("click", i.click.bind(i)));
164
- let e = t[0].id;
165
- t[0].id || (e = `${t[0].htmlFor}_Label`, t[0].id = e), i.setAttribute("aria-labelledby", e);
166
- }
167
- }, A = (i) => {
168
- const t = Array.from(i.elements).filter((l) => !l.tagName.includes("-") && l.validity).map((l) => l.validity.valid), e = y.get(i) || [], r = Array.from(e).filter((l) => l.isConnected).map((l) => c.get(l).validity.valid), o = [...t, ...r].includes(!1);
169
- i.toggleAttribute("internals-invalid", o), i.toggleAttribute("internals-valid", !o);
170
- }, lt = (i) => {
171
- A(T(i.target));
172
- }, ct = (i) => {
173
- A(T(i.target));
174
- }, dt = (i) => {
175
- const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((e) => `${e}:not([disabled])`).map((e) => `${e}:not([form])${i.id ? `,${e}[form='${i.id}']` : ""}`).join(",");
176
- i.addEventListener("click", (e) => {
177
- if (e.target.closest(t)) {
178
- const o = y.get(i);
179
- if (i.noValidate)
180
- return;
181
- o.size && Array.from(o).reverse().map((b) => c.get(b).reportValidity()).includes(!1) && e.preventDefault();
182
- }
183
- });
184
- }, vt = (i) => {
185
- const t = y.get(i.target);
186
- t && t.size && t.forEach((e) => {
187
- e.constructor.formAssociated && e.formResetCallback && e.formResetCallback.apply(e);
188
- });
189
- }, Y = (i, t, e) => {
190
- if (t) {
191
- const r = y.get(t);
192
- if (r)
193
- r.add(i);
194
- else {
195
- const o = /* @__PURE__ */ new Set();
196
- o.add(i), y.set(t, o), dt(t), t.addEventListener("reset", vt), t.addEventListener("input", lt), t.addEventListener("change", ct);
197
- }
198
- f.set(t, { ref: i, internals: e }), i.constructor.formAssociated && i.formAssociatedCallback && setTimeout(() => {
199
- i.formAssociatedCallback.apply(i, [t]);
200
- }, 0), A(t);
201
- }
202
- }, T = (i) => {
203
- let t = i.parentNode;
204
- return t && t.tagName !== "FORM" && (t = T(t)), t;
205
- }, x = (i, t, e = DOMException) => {
206
- if (!i.constructor.formAssociated)
207
- throw new e(t);
208
- }, Z = (i, t, e) => {
209
- const r = y.get(i);
210
- return r && r.size && r.forEach((o) => {
211
- c.get(o)[e]() || (t = !1);
212
- }), t;
213
- }, tt = (i) => {
214
- if (i.constructor.formAssociated) {
215
- const t = c.get(i), { labels: e, form: r } = t;
216
- X(i, e), Y(i, r, t);
217
- }
218
- };
219
- function I() {
220
- return typeof MutationObserver < "u";
221
- }
222
- class ht {
223
- constructor() {
224
- this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
225
- }
226
- }
227
- const mt = (i) => (i.badInput = !1, i.customError = !1, i.patternMismatch = !1, i.rangeOverflow = !1, i.rangeUnderflow = !1, i.stepMismatch = !1, i.tooLong = !1, i.tooShort = !1, i.typeMismatch = !1, i.valid = !0, i.valueMissing = !1, i), pt = (i, t, e) => (i.valid = ut(t), Object.keys(t).forEach((r) => i[r] = t[r]), e && A(e), i), ut = (i) => {
228
- let t = !0;
229
- for (let e in i)
230
- e !== "valid" && i[e] !== !1 && (t = !1);
231
- return t;
232
- }, $ = /* @__PURE__ */ new WeakMap();
233
- function et(i, t) {
234
- i.toggleAttribute(t, !0), i.part && i.part.add(t);
235
- }
236
- class V extends Set {
237
- static get isPolyfilled() {
238
- return !0;
239
- }
240
- constructor(t) {
241
- if (super(), !t || !t.tagName || t.tagName.indexOf("-") === -1)
242
- throw new TypeError("Illegal constructor");
243
- $.set(this, t);
244
- }
245
- add(t) {
246
- if (!/^--/.test(t) || typeof t != "string")
247
- throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
248
- const e = super.add(t), r = $.get(this), o = `state${t}`;
249
- return r.isConnected ? et(r, o) : setTimeout(() => {
250
- et(r, o);
251
- }), e;
252
- }
253
- clear() {
254
- for (let [t] of this.entries())
255
- this.delete(t);
256
- super.clear();
257
- }
258
- delete(t) {
259
- const e = super.delete(t), r = $.get(this);
260
- return r.isConnected ? (r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`)) : setTimeout(() => {
261
- r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`);
262
- }), e;
263
- }
264
- }
265
- function it(i, t, e, r) {
266
- if (e === "a" && !r)
267
- throw new TypeError("Private accessor was defined without a getter");
268
- if (typeof t == "function" ? i !== t || !r : !t.has(i))
269
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
270
- return e === "m" ? r : e === "a" ? r.call(i) : r ? r.value : t.get(i);
271
- }
272
- function bt(i, t, e, r, o) {
273
- if (r === "m")
274
- throw new TypeError("Private method is not writable");
275
- if (r === "a" && !o)
276
- throw new TypeError("Private accessor was defined without a setter");
277
- if (typeof t == "function" ? i !== t || !o : !t.has(i))
278
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
279
- return r === "a" ? o.call(i, e) : o ? o.value = e : t.set(i, e), e;
280
- }
281
- var C;
282
- class ft {
283
- constructor(t) {
284
- C.set(this, void 0), bt(this, C, t, "f");
285
- for (let e = 0; e < t.length; e++) {
286
- let r = t[e];
287
- this[e] = r, r.hasAttribute("name") && (this[r.getAttribute("name")] = r);
288
- }
289
- Object.freeze(this);
290
- }
291
- get length() {
292
- return it(this, C, "f").length;
293
- }
294
- [(C = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
295
- return it(this, C, "f")[Symbol.iterator]();
296
- }
297
- item(t) {
298
- return this[t] == null ? null : this[t];
299
- }
300
- namedItem(t) {
301
- return this[t] == null ? null : this[t];
302
- }
303
- }
304
- function gt() {
305
- const i = HTMLFormElement.prototype.checkValidity;
306
- HTMLFormElement.prototype.checkValidity = e;
307
- const t = HTMLFormElement.prototype.reportValidity;
308
- HTMLFormElement.prototype.reportValidity = r;
309
- function e(...l) {
310
- let n = i.apply(this, l);
311
- return Z(this, n, "checkValidity");
312
- }
313
- function r(...l) {
314
- let n = t.apply(this, l);
315
- return Z(this, n, "reportValidity");
316
- }
317
- const { get: o } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
318
- Object.defineProperty(HTMLFormElement.prototype, "elements", {
319
- get(...l) {
320
- const n = o.call(this, ...l), b = Array.from(y.get(this) || []);
321
- if (b.length === 0)
322
- return n;
323
- const d = Array.from(n).concat(b).sort((E, w) => E.compareDocumentPosition ? E.compareDocumentPosition(w) & 2 ? 1 : -1 : 0);
324
- return new ft(d);
325
- }
326
- });
327
- }
328
- class rt {
329
- static get isPolyfilled() {
330
- return !0;
190
+ }, tt = (e, t, i) => {
191
+ if (t) {
192
+ const r = b.get(t);
193
+ if (r)
194
+ r.add(e);
195
+ else {
196
+ const o = /* @__PURE__ */ new Set();
197
+ o.add(e), b.set(t, o), ut(t), t.addEventListener("reset", ft), t.addEventListener("input", mt), t.addEventListener("change", pt);
198
+ }
199
+ y.set(t, { ref: e, internals: i }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
200
+ e.formAssociatedCallback.apply(e, [t]);
201
+ }, 0), I(t);
202
+ }
203
+ }, T = (e) => {
204
+ let t = e.parentNode;
205
+ return t && t.tagName !== "FORM" && (t = T(t)), t;
206
+ }, w = (e, t, i = DOMException) => {
207
+ if (!e.constructor.formAssociated)
208
+ throw new i(t);
209
+ }, et = (e, t, i) => {
210
+ const r = b.get(e);
211
+ return r && r.size && r.forEach((o) => {
212
+ c.get(o)[i]() || (t = !1);
213
+ }), t;
214
+ }, it = (e) => {
215
+ if (e.constructor.formAssociated) {
216
+ const t = c.get(e), { labels: i, form: r } = t;
217
+ Z(e, i), tt(e, r, t);
218
+ }
219
+ };
220
+ function V() {
221
+ return typeof MutationObserver < "u";
331
222
  }
332
- constructor(t) {
333
- if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
334
- throw new TypeError("Illegal constructor");
335
- const e = t.getRootNode(), r = new ht();
336
- this.states = new V(t), p.set(this, t), s.set(this, r), c.set(t, this), ot(t, this), st(t, this), Object.seal(this), e instanceof DocumentFragment && nt(e);
223
+ class bt {
224
+ constructor() {
225
+ this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
226
+ }
337
227
  }
338
- checkValidity() {
339
- const t = p.get(this);
340
- if (x(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
228
+ const gt = (e) => (e.badInput = !1, e.customError = !1, e.patternMismatch = !1, e.rangeOverflow = !1, e.rangeUnderflow = !1, e.stepMismatch = !1, e.tooLong = !1, e.tooShort = !1, e.typeMismatch = !1, e.valid = !0, e.valueMissing = !1, e), yt = (e, t, i) => (e.valid = wt(t), Object.keys(t).forEach((r) => e[r] = t[r]), i && I(i), e), wt = (e) => {
229
+ let t = !0;
230
+ for (let i in e)
231
+ i !== "valid" && e[i] !== !1 && (t = !1);
232
+ return t;
233
+ }, O = /* @__PURE__ */ new WeakMap();
234
+ function rt(e, t) {
235
+ e.toggleAttribute(t, !0), e.part && e.part.add(t);
236
+ }
237
+ class $ extends Set {
238
+ static get isPolyfilled() {
341
239
  return !0;
342
- const e = s.get(this);
343
- if (!e.valid) {
344
- const r = new Event("invalid", {
345
- bubbles: !1,
346
- cancelable: !0,
347
- composed: !1
348
- });
349
- t.dispatchEvent(r);
350
240
  }
351
- return e.valid;
241
+ constructor(t) {
242
+ if (super(), !t || !t.tagName || t.tagName.indexOf("-") === -1)
243
+ throw new TypeError("Illegal constructor");
244
+ O.set(this, t);
245
+ }
246
+ add(t) {
247
+ if (!/^--/.test(t) || typeof t != "string")
248
+ throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
249
+ const i = super.add(t), r = O.get(this), o = `state${t}`;
250
+ return r.isConnected ? rt(r, o) : setTimeout(() => {
251
+ rt(r, o);
252
+ }), i;
253
+ }
254
+ clear() {
255
+ for (let [t] of this.entries())
256
+ this.delete(t);
257
+ super.clear();
258
+ }
259
+ delete(t) {
260
+ const i = super.delete(t), r = O.get(this);
261
+ return r.isConnected ? (r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`)) : setTimeout(() => {
262
+ r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`);
263
+ }), i;
264
+ }
352
265
  }
353
- get form() {
354
- const t = p.get(this);
355
- x(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
356
- let e;
357
- return t.constructor.formAssociated === !0 && (e = T(t)), e;
266
+ function ot(e, t, i, r) {
267
+ if (i === "a" && !r)
268
+ throw new TypeError("Private accessor was defined without a getter");
269
+ if (typeof t == "function" ? e !== t || !r : !t.has(e))
270
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
271
+ return i === "m" ? r : i === "a" ? r.call(e) : r ? r.value : t.get(e);
272
+ }
273
+ function xt(e, t, i, r, o) {
274
+ if (r === "m")
275
+ throw new TypeError("Private method is not writable");
276
+ if (r === "a" && !o)
277
+ throw new TypeError("Private accessor was defined without a setter");
278
+ if (typeof t == "function" ? e !== t || !o : !t.has(e))
279
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
280
+ return r === "a" ? o.call(e, i) : o ? o.value = i : t.set(e, i), i;
281
+ }
282
+ var z;
283
+ class Et {
284
+ constructor(t) {
285
+ z.set(this, void 0), xt(this, z, t, "f");
286
+ for (let i = 0; i < t.length; i++) {
287
+ let r = t[i];
288
+ this[i] = r, r.hasAttribute("name") && (this[r.getAttribute("name")] = r);
289
+ }
290
+ Object.freeze(this);
291
+ }
292
+ get length() {
293
+ return ot(this, z, "f").length;
294
+ }
295
+ [(z = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
296
+ return ot(this, z, "f")[Symbol.iterator]();
297
+ }
298
+ item(t) {
299
+ return this[t] == null ? null : this[t];
300
+ }
301
+ namedItem(t) {
302
+ return this[t] == null ? null : this[t];
303
+ }
358
304
  }
359
- get labels() {
360
- const t = p.get(this);
361
- x(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
362
- const e = t.getAttribute("id"), r = t.getRootNode();
363
- return r && e ? r.querySelectorAll(`[for="${e}"]`) : [];
305
+ function kt() {
306
+ const e = HTMLFormElement.prototype.checkValidity;
307
+ HTMLFormElement.prototype.checkValidity = i;
308
+ const t = HTMLFormElement.prototype.reportValidity;
309
+ HTMLFormElement.prototype.reportValidity = r;
310
+ function i(...s) {
311
+ let l = e.apply(this, s);
312
+ return et(this, l, "checkValidity");
313
+ }
314
+ function r(...s) {
315
+ let l = t.apply(this, s);
316
+ return et(this, l, "reportValidity");
317
+ }
318
+ const { get: o } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
319
+ Object.defineProperty(HTMLFormElement.prototype, "elements", {
320
+ get(...s) {
321
+ const l = o.call(this, ...s), u = Array.from(b.get(this) || []);
322
+ if (u.length === 0)
323
+ return l;
324
+ const d = Array.from(l).concat(u).sort((x, g) => x.compareDocumentPosition ? x.compareDocumentPosition(g) & 2 ? 1 : -1 : 0);
325
+ return new Et(d);
326
+ }
327
+ });
364
328
  }
365
- reportValidity() {
366
- const t = p.get(this);
367
- if (x(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
329
+ class at {
330
+ static get isPolyfilled() {
368
331
  return !0;
369
- const e = this.checkValidity(), r = B.get(this);
370
- if (r && !t.constructor.formAssociated)
371
- throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
372
- return !e && r && (t.focus(), r.focus()), e;
373
- }
374
- setFormValue(t) {
375
- const e = p.get(this);
376
- if (x(e, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), J(this), t != null && !(t instanceof FormData)) {
377
- if (e.getAttribute("name")) {
378
- const r = Q(e, this);
379
- r.value = t;
332
+ }
333
+ constructor(t) {
334
+ if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
335
+ throw new TypeError("Illegal constructor");
336
+ const i = t.getRootNode(), r = new bt();
337
+ this.states = new $(t), a.set(this, t), n.set(this, r), c.set(t, this), ct(t, this), ht(t, this), Object.seal(this), i instanceof DocumentFragment && vt(i);
338
+ }
339
+ checkValidity() {
340
+ const t = a.get(this);
341
+ if (w(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
342
+ return !0;
343
+ const i = n.get(this);
344
+ if (!i.valid) {
345
+ const r = new Event("invalid", {
346
+ bubbles: !1,
347
+ cancelable: !0,
348
+ composed: !1
349
+ });
350
+ t.dispatchEvent(r);
380
351
  }
381
- } else
382
- t != null && t instanceof FormData && Array.from(t).reverse().forEach(([r, o]) => {
383
- if (typeof o == "string") {
384
- const l = Q(e, this);
385
- l.name = r, l.value = o;
352
+ return i.valid;
353
+ }
354
+ get form() {
355
+ const t = a.get(this);
356
+ w(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
357
+ let i;
358
+ return t.constructor.formAssociated === !0 && (i = T(t)), i;
359
+ }
360
+ get labels() {
361
+ const t = a.get(this);
362
+ w(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
363
+ const i = t.getAttribute("id"), r = t.getRootNode();
364
+ return r && i ? r.querySelectorAll(`[for="${i}"]`) : [];
365
+ }
366
+ reportValidity() {
367
+ const t = a.get(this);
368
+ if (w(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
369
+ return !0;
370
+ const i = this.checkValidity(), r = U.get(this);
371
+ if (r && !t.constructor.formAssociated)
372
+ throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
373
+ return !i && r && (t.focus(), r.focus()), i;
374
+ }
375
+ setFormValue(t) {
376
+ const i = a.get(this);
377
+ if (w(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), X(this), t != null && !(t instanceof FormData)) {
378
+ if (i.getAttribute("name")) {
379
+ const r = Y(i, this);
380
+ r.value = t;
386
381
  }
387
- });
388
- M.set(e, t);
389
- }
390
- setValidity(t, e, r) {
391
- const o = p.get(this);
392
- if (x(o, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
393
- throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
394
- B.set(this, r);
395
- const l = s.get(this), n = {};
396
- for (const E in t)
397
- n[E] = t[E];
398
- Object.keys(n).length === 0 && mt(l);
399
- const b = { ...l, ...n };
400
- delete b.valid;
401
- const { valid: d } = pt(l, b, this.form);
402
- if (!d && !e)
403
- throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
404
- u.set(this, d ? "" : e), o.isConnected ? (o.toggleAttribute("internals-invalid", !d), o.toggleAttribute("internals-valid", d), o.setAttribute("aria-invalid", `${!d}`)) : F.set(o, this);
405
- }
406
- get shadowRoot() {
407
- const t = p.get(this), e = H.get(t);
408
- return e || null;
409
- }
410
- get validationMessage() {
411
- const t = p.get(this);
412
- return x(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), u.get(this);
413
- }
414
- get validity() {
415
- const t = p.get(this);
416
- return x(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), s.get(this);
417
- }
418
- get willValidate() {
419
- const t = p.get(this);
420
- return x(t, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(t.disabled || t.hasAttribute("disabled") || t.hasAttribute("readonly"));
421
- }
422
- }
423
- function yt() {
424
- if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)
425
- return !1;
426
- class i extends HTMLElement {
427
- constructor() {
428
- super(), this.internals = this.attachInternals();
382
+ } else
383
+ t != null && t instanceof FormData && Array.from(t).reverse().forEach(([r, o]) => {
384
+ if (typeof o == "string") {
385
+ const s = Y(i, this);
386
+ s.name = r, s.value = o;
387
+ }
388
+ });
389
+ S.set(i, t);
390
+ }
391
+ setValidity(t, i, r) {
392
+ const o = a.get(this);
393
+ if (w(o, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
394
+ throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
395
+ U.set(this, r);
396
+ const s = n.get(this), l = {};
397
+ for (const x in t)
398
+ l[x] = t[x];
399
+ Object.keys(l).length === 0 && gt(s);
400
+ const u = { ...s, ...l };
401
+ delete u.valid;
402
+ const { valid: d } = yt(s, u, this.form);
403
+ if (!d && !i)
404
+ throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
405
+ f.set(this, d ? "" : i), o.isConnected ? (o.toggleAttribute("internals-invalid", !d), o.toggleAttribute("internals-valid", d), o.setAttribute("aria-invalid", `${!d}`)) : L.set(o, this);
406
+ }
407
+ get shadowRoot() {
408
+ const t = a.get(this), i = K.get(t);
409
+ return i || null;
410
+ }
411
+ get validationMessage() {
412
+ const t = a.get(this);
413
+ return w(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), f.get(this);
414
+ }
415
+ get validity() {
416
+ const t = a.get(this);
417
+ return w(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), n.get(this);
418
+ }
419
+ get willValidate() {
420
+ const t = a.get(this);
421
+ return w(t, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(t.disabled || t.hasAttribute("disabled") || t.hasAttribute("readonly"));
429
422
  }
430
423
  }
431
- const t = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
432
- customElements.define(t, i);
433
- const e = new i();
434
- return [
435
- "shadowRoot",
436
- "form",
437
- "willValidate",
438
- "validity",
439
- "validationMessage",
440
- "labels",
441
- "setFormValue",
442
- "setValidity",
443
- "checkValidity",
444
- "reportValidity"
445
- ].every((r) => r in e.internals);
446
- }
447
- if (yt()) {
448
- if (typeof window < "u" && !window.CustomStateSet) {
449
- window.CustomStateSet = V;
450
- const i = HTMLElement.prototype.attachInternals;
451
- HTMLElement.prototype.attachInternals = function(...t) {
452
- const e = i.call(this, t);
453
- return e.states = new V(this), e;
454
- };
455
- }
456
- } else {
457
- if (typeof window < "u" && (window.ElementInternals = rt), typeof CustomElementRegistry < "u") {
458
- const i = CustomElementRegistry.prototype.define;
459
- CustomElementRegistry.prototype.define = function(t, e, r) {
460
- if (e.formAssociated) {
461
- const o = e.prototype.connectedCallback;
462
- e.prototype.connectedCallback = function() {
463
- q.has(this) || (q.set(this, !0), this.hasAttribute("disabled") && D(this, !0)), o != null && o.apply(this), tt(this);
424
+ function Mt() {
425
+ if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)
426
+ return !1;
427
+ class e extends HTMLElement {
428
+ constructor() {
429
+ super(), this.internals = this.attachInternals();
430
+ }
431
+ }
432
+ const t = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
433
+ customElements.define(t, e);
434
+ const i = new e();
435
+ return [
436
+ "shadowRoot",
437
+ "form",
438
+ "willValidate",
439
+ "validity",
440
+ "validationMessage",
441
+ "labels",
442
+ "setFormValue",
443
+ "setValidity",
444
+ "checkValidity",
445
+ "reportValidity"
446
+ ].every((r) => r in i.internals);
447
+ }
448
+ let nt = !1, st = !1;
449
+ function W(e) {
450
+ st || (st = !0, window.CustomStateSet = $, e && (HTMLElement.prototype.attachInternals = function(...t) {
451
+ const i = e.call(this, t);
452
+ return i.states = new $(this), i;
453
+ }));
454
+ }
455
+ function lt(e = !0) {
456
+ if (!nt) {
457
+ if (nt = !0, typeof window < "u" && (window.ElementInternals = at), typeof CustomElementRegistry < "u") {
458
+ const t = CustomElementRegistry.prototype.define;
459
+ CustomElementRegistry.prototype.define = function(i, r, o) {
460
+ if (r.formAssociated) {
461
+ const s = r.prototype.connectedCallback;
462
+ r.prototype.connectedCallback = function() {
463
+ j.has(this) || (j.set(this, !0), this.hasAttribute("disabled") && D(this, !0)), s != null && s.apply(this), it(this);
464
+ };
465
+ }
466
+ t.call(this, i, r, o);
464
467
  };
465
468
  }
466
- i.call(this, t, e, r);
467
- };
468
- }
469
- if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
470
- if (this.tagName) {
471
- if (this.tagName.indexOf("-") === -1)
472
- throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");
473
- } else
474
- return {};
475
- if (c.has(this))
476
- throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
477
- return new rt(this);
478
- }), typeof Element < "u") {
479
- let i = function(...e) {
480
- const r = t.apply(this, e);
481
- if (H.set(this, r), I()) {
482
- const o = new MutationObserver(_);
483
- window.ShadyDOM ? o.observe(this, P) : o.observe(r, P), g.set(this, o);
469
+ if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
470
+ if (this.tagName) {
471
+ if (this.tagName.indexOf("-") === -1)
472
+ throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");
473
+ } else
474
+ return {};
475
+ if (c.has(this))
476
+ throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
477
+ return new at(this);
478
+ }), typeof Element < "u") {
479
+ let t = function(...r) {
480
+ const o = i.apply(this, r);
481
+ if (K.set(this, o), V()) {
482
+ const s = new MutationObserver(R);
483
+ window.ShadyDOM ? s.observe(this, _) : s.observe(o, _), M.set(this, s);
484
+ }
485
+ return o;
486
+ };
487
+ const i = Element.prototype.attachShadow;
488
+ Element.prototype.attachShadow = t;
484
489
  }
485
- return r;
486
- };
487
- const t = Element.prototype.attachShadow;
488
- Element.prototype.attachShadow = i;
490
+ V() && typeof document < "u" && new MutationObserver(R).observe(document.documentElement, _), typeof HTMLFormElement < "u" && kt(), (e || typeof window < "u" && !window.CustomStateSet) && W();
491
+ }
489
492
  }
490
- I() && typeof document < "u" && new MutationObserver(_).observe(document.documentElement, P), typeof HTMLFormElement < "u" && gt(), typeof window < "u" && !window.CustomStateSet && (window.CustomStateSet = V);
491
- }
493
+ return !!customElements.polyfillWrapFlushCallback || (Mt() ? typeof window < "u" && !window.CustomStateSet && W(HTMLElement.prototype.attachInternals) : lt(!1)), E.forceCustomStateSetPolyfill = W, E.forceElementInternalsPolyfill = lt, Object.defineProperty(E, "__esModule", { value: !0 }), E;
494
+ })({});
492
495
  })();
493
- var At = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, m = (p, s, a, c) => {
494
- for (var u = c > 1 ? void 0 : c ? Tt(s, a) : s, f = p.length - 1, g; f >= 0; f--)
495
- (g = p[f]) && (u = (c ? g(s, a, u) : g(u)) || u);
496
- return c && u && At(s, a, u), u;
496
+ var Pt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, p = (E, a, n, h) => {
497
+ for (var c = h > 1 ? void 0 : h ? Rt(a, n) : a, f = E.length - 1, y; f >= 0; f--)
498
+ (y = E[f]) && (c = (h ? y(a, n, c) : y(c)) || c);
499
+ return h && c && Pt(a, n, c), c;
497
500
  };
498
- const L = "pie-button";
499
- class v extends kt(wt) {
501
+ const C = "pie-button";
502
+ class v extends Ft(zt) {
500
503
  constructor() {
501
- super(...arguments), this.size = "medium", this.type = "submit", this.variant = "primary", this.iconPlacement = "leading", this.disabled = !1, this.isLoading = !1, this.isFullWidth = !1, this.isResponsive = !1, this._handleFormKeyDown = (s) => {
502
- if (!(s.key !== "Enter" || this.type !== "submit" || this.disabled)) {
503
- if (s.target instanceof HTMLElement) {
504
- const a = s.target.tagName.toLowerCase();
505
- if (a === "button" || a === "pie-button")
504
+ super(...arguments), this.size = "medium", this.type = "submit", this.variant = "primary", this.iconPlacement = "leading", this.disabled = !1, this.isLoading = !1, this.isFullWidth = !1, this.isResponsive = !1, this._handleFormKeyDown = (a) => {
505
+ if (!(a.key !== "Enter" || this.type !== "submit" || this.disabled)) {
506
+ if (a.target instanceof HTMLElement) {
507
+ const n = a.target.tagName.toLowerCase();
508
+ if (n === "button" || n === "pie-button")
506
509
  return;
507
510
  }
508
- s.preventDefault(), this._handleClick();
511
+ a.preventDefault(), this._handleClick();
509
512
  }
510
513
  };
511
514
  }
512
515
  connectedCallback() {
513
- var s;
514
- super.connectedCallback(), this.type === "submit" && ((s = this.form) == null || s.addEventListener("keydown", this._handleFormKeyDown));
516
+ var a;
517
+ super.connectedCallback(), this.type === "submit" && ((a = this.form) == null || a.addEventListener("keydown", this._handleFormKeyDown));
515
518
  }
516
519
  disconnectedCallback() {
517
- var s;
518
- super.disconnectedCallback(), this.type === "submit" && ((s = this.form) == null || s.removeEventListener("keydown", this._handleFormKeyDown));
520
+ var a;
521
+ super.disconnectedCallback(), this.type === "submit" && ((a = this.form) == null || a.removeEventListener("keydown", this._handleFormKeyDown));
519
522
  }
520
- updated(s) {
521
- var a, c;
522
- super.updated(s), s.has("type") && (this.type === "submit" ? (a = this.form) == null || a.addEventListener("keydown", this._handleFormKeyDown) : (c = this.form) == null || c.removeEventListener("keydown", this._handleFormKeyDown));
523
+ updated(a) {
524
+ var n, h;
525
+ super.updated(a), a.has("type") && (this.type === "submit" ? (n = this.form) == null || n.addEventListener("keydown", this._handleFormKeyDown) : (h = this.form) == null || h.removeEventListener("keydown", this._handleFormKeyDown));
523
526
  }
524
527
  /**
525
528
  * This method creates an invisible button of the same type as pie-button. It is then clicked, and immediately removed from the DOM.
@@ -529,11 +532,11 @@ class v extends kt(wt) {
529
532
  *
530
533
  * TODO: if we need to repeat this logic elsewhere, then we should consider moving this code to a shared class or mixin.
531
534
  */
532
- _simulateNativeButtonClick(s) {
535
+ _simulateNativeButtonClick(a) {
533
536
  if (!this.form)
534
537
  return;
535
- const a = document.createElement("button");
536
- a.type = s, a.style.position = "absolute", a.style.width = "1px", a.style.height = "1px", a.style.padding = "0", a.style.margin = "-1px", a.style.overflow = "hidden", a.style.border = "0", a.style.whiteSpace = "nowrap", s === "submit" && (this.name && (a.name = this.name), this.value && (a.value = this.value), this.formaction && a.setAttribute("formaction", this.formaction), this.formenctype && a.setAttribute("formenctype", this.formenctype), this.formmethod && a.setAttribute("formmethod", this.formmethod), this.formnovalidate && a.setAttribute("formnovalidate", "formnovalidate"), this.formtarget && a.setAttribute("formtarget", this.formtarget)), this.form.append(a), a.click(), a.remove();
538
+ const n = document.createElement("button");
539
+ n.type = a, n.style.position = "absolute", n.style.width = "1px", n.style.height = "1px", n.style.padding = "0", n.style.margin = "-1px", n.style.overflow = "hidden", n.style.border = "0", n.style.whiteSpace = "nowrap", a === "submit" && (this.name && (n.name = this.name), this.value && (n.value = this.value), this.formaction && n.setAttribute("formaction", this.formaction), this.formenctype && n.setAttribute("formenctype", this.formenctype), this.formmethod && n.setAttribute("formmethod", this.formmethod), this.formnovalidate && n.setAttribute("formnovalidate", "formnovalidate"), this.formtarget && n.setAttribute("formtarget", this.formtarget)), this.form.append(n), n.click(), n.remove();
537
540
  }
538
541
  _handleClick() {
539
542
  !this.isLoading && this.form && (this.type === "submit" && (this.formnovalidate || this.form.reportValidity()) && this._simulateNativeButtonClick("submit"), this.type === "reset" && this._simulateNativeButtonClick("reset"));
@@ -544,111 +547,111 @@ class v extends kt(wt) {
544
547
  * @private
545
548
  */
546
549
  renderSpinner() {
547
- const { size: s, variant: a, disabled: c } = this, u = s && s.includes("small") ? "small" : "medium";
550
+ const { size: a, variant: n, disabled: h } = this, c = a && a.includes("small") ? "small" : "medium";
548
551
  let f;
549
- return c ? f = a === "ghost-inverse" ? "inverse" : "secondary" : f = ["primary", "destructive", "outline-inverse", "ghost-inverse"].includes(this.variant) ? "inverse" : "secondary", N`
552
+ return h ? f = n === "ghost-inverse" ? "inverse" : "secondary" : f = ["primary", "destructive", "outline-inverse", "ghost-inverse"].includes(this.variant) ? "inverse" : "secondary", N`
550
553
  <pie-spinner
551
- size="${u}"
554
+ size="${c}"
552
555
  variant="${f}">
553
556
  </pie-spinner>`;
554
557
  }
555
558
  render() {
556
559
  const {
557
- type: s,
558
- disabled: a,
559
- isFullWidth: c,
560
- variant: u,
560
+ type: a,
561
+ disabled: n,
562
+ isFullWidth: h,
563
+ variant: c,
561
564
  size: f,
562
- isLoading: g,
563
- isResponsive: y,
564
- iconPlacement: M,
565
- responsiveSize: k
565
+ isLoading: y,
566
+ isResponsive: M,
567
+ iconPlacement: b,
568
+ responsiveSize: S
566
569
  } = this;
567
570
  return N`
568
571
  <button
569
572
  @click=${this._handleClick}
570
573
  class="o-btn"
571
- type=${s || "submit"}
572
- variant=${u || "primary"}
574
+ type=${a || "submit"}
575
+ variant=${c || "primary"}
573
576
  size=${f || "medium"}
574
- responsiveSize=${Et(k)}
575
- ?disabled=${a}
576
- ?isFullWidth=${c}
577
- ?isResponsive=${y}
578
- ?isLoading=${g}>
579
- ${g ? this.renderSpinner() : W}
580
- ${M === "leading" ? N`<slot name="icon"></slot>` : W}
577
+ responsiveSize=${St(S)}
578
+ ?disabled=${n}
579
+ ?isFullWidth=${h}
580
+ ?isResponsive=${M}
581
+ ?isLoading=${y}>
582
+ ${y ? this.renderSpinner() : B}
583
+ ${b === "leading" ? N`<slot name="icon"></slot>` : B}
581
584
  <slot></slot>
582
- ${M === "trailing" ? N`<slot name="icon"></slot>` : W}
585
+ ${b === "trailing" ? N`<slot name="icon"></slot>` : B}
583
586
  </button>`;
584
587
  }
585
588
  focus() {
586
- var s, a;
587
- (a = (s = this.shadowRoot) == null ? void 0 : s.querySelector("button")) == null || a.focus();
589
+ var a, n;
590
+ (n = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button")) == null || n.focus();
588
591
  }
589
592
  }
590
- v.styles = xt(St);
591
- m([
592
- h(),
593
- R(L, Mt, "medium")
593
+ v.styles = Ct(Nt);
594
+ p([
595
+ m(),
596
+ P(C, At, "medium")
594
597
  ], v.prototype, "size", 2);
595
- m([
596
- h(),
597
- R(L, Ct, "submit")
598
+ p([
599
+ m(),
600
+ P(C, It, "submit")
598
601
  ], v.prototype, "type", 2);
599
- m([
600
- h(),
601
- R(L, Lt, "primary")
602
+ p([
603
+ m(),
604
+ P(C, Tt, "primary")
602
605
  ], v.prototype, "variant", 2);
603
- m([
604
- h({ type: String }),
605
- R(L, Ft, "leading")
606
+ p([
607
+ m({ type: String }),
608
+ P(C, Vt, "leading")
606
609
  ], v.prototype, "iconPlacement", 2);
607
- m([
608
- h({ type: Boolean })
610
+ p([
611
+ m({ type: Boolean })
609
612
  ], v.prototype, "disabled", 2);
610
- m([
611
- h({ type: Boolean, reflect: !0 })
613
+ p([
614
+ m({ type: Boolean, reflect: !0 })
612
615
  ], v.prototype, "isLoading", 2);
613
- m([
614
- h({ type: Boolean })
616
+ p([
617
+ m({ type: Boolean })
615
618
  ], v.prototype, "isFullWidth", 2);
616
- m([
617
- h({ type: Boolean })
619
+ p([
620
+ m({ type: Boolean })
618
621
  ], v.prototype, "isResponsive", 2);
619
- m([
620
- h({ type: String })
622
+ p([
623
+ m({ type: String })
621
624
  ], v.prototype, "name", 2);
622
- m([
623
- h({ type: String })
625
+ p([
626
+ m({ type: String })
624
627
  ], v.prototype, "value", 2);
625
- m([
626
- h()
628
+ p([
629
+ m()
627
630
  ], v.prototype, "formaction", 2);
628
- m([
629
- h()
631
+ p([
632
+ m()
630
633
  ], v.prototype, "formenctype", 2);
631
- m([
632
- h()
634
+ p([
635
+ m()
633
636
  ], v.prototype, "formmethod", 2);
634
- m([
635
- h({ type: Boolean })
637
+ p([
638
+ m({ type: Boolean })
636
639
  ], v.prototype, "formnovalidate", 2);
637
- m([
638
- h()
640
+ p([
641
+ m()
639
642
  ], v.prototype, "formtarget", 2);
640
- m([
641
- h({ type: String })
643
+ p([
644
+ m({ type: String })
642
645
  ], v.prototype, "responsiveSize", 2);
643
- zt(L, v);
646
+ Lt(C, v);
644
647
  export {
645
648
  v as PieButton,
646
- Dt as formEncodingtypes,
647
- $t as formMethodTypes,
648
- Ot as formTargetTypes,
649
- Ft as iconPlacements,
650
- Pt as responsiveSizes,
651
- Mt as sizes,
652
- Ct as types,
653
- Lt as variants
649
+ Kt as formEncodingtypes,
650
+ Ut as formMethodTypes,
651
+ qt as formTargetTypes,
652
+ Vt as iconPlacements,
653
+ Bt as responsiveSizes,
654
+ At as sizes,
655
+ It as types,
656
+ Tt as variants
654
657
  };