/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
'use strict';

var index = require('./index-DjlJwy91.js');
var theme = require('./theme-IlOsGAz7.js');
var ionicGlobal = require('./ionic-global-Dq_E1GCa.js');

const chipIonicCss = ":host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-inline-flexbox;display:inline-flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:var(--background);color:var(--color);cursor:pointer;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}:host(.chip-disabled){cursor:default;pointer-events:none}:host{--focus-ring-color:var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));--focus-ring-width:var(--token-border-size-050, var(--token-scale-050, 2px));-webkit-padding-start:var(--token-space-200, var(--token-scale-200, 8px));padding-inline-start:var(--token-space-200, var(--token-scale-200, 8px));-webkit-padding-end:var(--token-space-200, var(--token-scale-200, 8px));padding-inline-end:var(--token-space-200, var(--token-scale-200, 8px));padding-top:var(--token-space-150, var(--token-scale-150, 6px));padding-bottom:var(--token-space-150, var(--token-scale-150, 6px));border-radius:var(--border-radius);font-size:var(--token-font-size-300, 12px);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-0, 0%);line-height:var(--token-font-line-height-500, var(--token-scale-500, 20px));text-decoration:none;text-transform:none;gap:var(--token-space-100, var(--token-scale-100, 4px));line-height:var(--token-font-line-height-full, 100%);cursor:auto}:host(.chip-outline){border-width:var(--token-border-size-025, var(--token-scale-025, 1px));border-style:var(--token-border-style-solid, solid)}:host(.ion-focused){outline-offset:var(--token-border-size-050, var(--token-scale-050, 2px));outline:var(--token-border-size-050, var(--token-scale-050, 2px)) var(--token-border-style-solid, solid) var(--focus-ring-color)}:host(.chip-disabled)::after{right:0;left:0;top:0;bottom:0;position:absolute;background-color:var(--token-state-disabled, rgba(255, 255, 255, 0.6));content:\"\";pointer-events:none}:host(.chip-soft){--border-radius:var(--token-border-radius-100, var(--token-scale-100, 4px))}:host(.chip-round){--border-radius:var(--token-border-radius-400, var(--token-scale-400, 16px))}:host(.chip-rectangular){--border-radius:var(--token-border-radius-0, var(--token-scale-0, 0px))}::slotted(ion-icon){font-size:var(--token-font-size-400, 16px)}:host(.chip-small){min-height:var(--token-scale-600, 24px);font-size:var(--token-font-size-300, 12px)}:host(.chip-large){min-height:var(--token-scale-800, 32px);font-size:var(--token-font-size-350, 14px)}:host(.chip-subtle){--background:var(--token-primitives-neutral-100, #f3f3f3);--color:var(--token-primitives-neutral-800, #626262)}:host(.chip-outline.chip-subtle){border-color:var(--token-primitives-neutral-300, #e0e0e0)}:host(.chip-bold){--background:var(--token-bg-neutral-bold-default, var(--token-primitives-neutral-1000, #3b3b3b));--color:var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff))}:host(.chip-outline.chip-bold){border-color:var(--token-text-default, var(--token-primitives-neutral-1200, #242424))}:host(.chip-subtle.ion-color){background:var(--ion-color-subtle-base);color:var(--ion-color-subtle-contrast)}:host(.chip-subtle.chip-outline.ion-color){border-color:var(--ion-color-subtle-shade)}:host(.chip-bold.ion-color){background:var(--ion-color-base);color:var(--ion-color-contrast)}:host(.chip-bold.chip-outline.ion-color){border-color:var(--ion-color-shade)}";

const chipIosCss = ":host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-inline-flexbox;display:inline-flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:var(--background);color:var(--color);cursor:pointer;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}:host(.chip-disabled){cursor:default;pointer-events:none}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.87);border-radius:var(--border-radius);-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:4px;margin-inline-end:4px;margin-top:4px;margin-bottom:4px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;min-height:32px;font-family:var(--ion-font-family, inherit)}:host(.chip-disabled){opacity:0.4}:host(.ion-color){background:rgba(var(--ion-color-base-rgb), 0.08);color:var(--ion-color-shade)}:host(.ion-color:focus){background:rgba(var(--ion-color-base-rgb), 0.12)}:host(.ion-color.ion-activated){background:rgba(var(--ion-color-base-rgb), 0.16)}@media (any-hover: hover){:host(.ion-color:hover){background:rgba(var(--ion-color-base-rgb), 0.12)}}:host(.chip-outline){border-width:1px;border-style:solid}:host(.chip-outline){border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.32);background:transparent}:host(.chip-outline.ion-color){border-color:rgba(var(--ion-color-base-rgb), 0.32)}:host(.chip-outline:not(.ion-color):focus){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)}:host(.chip-outline.ion-activated:not(.ion-color)){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)}::slotted(ion-icon){font-size:1.4285714286em}:host(:not(.ion-color)) ::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54)}::slotted(ion-icon:first-child){-webkit-margin-start:-4px;margin-inline-start:-4px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:-4px;margin-bottom:-4px}::slotted(ion-icon:last-child){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-4px;margin-inline-end:-4px;margin-top:-4px;margin-bottom:-4px}::slotted(ion-avatar){-ms-flex-negative:0;flex-shrink:0;width:1.7142857143em;height:1.7142857143em}::slotted(ion-avatar:first-child){-webkit-margin-start:-8px;margin-inline-start:-8px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:-4px;margin-bottom:-4px}::slotted(ion-avatar:last-child){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-8px;margin-inline-end:-8px;margin-top:-4px;margin-bottom:-4px}:host(:focus){outline:none}:host(:focus){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}:host(.ion-activated){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}@media (any-hover: hover){:host(:hover){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}:host(.ion-color:hover){background:rgba(var(--ion-color-base-rgb), 0.12)}:host(.chip-outline:not(.ion-color):hover){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)}}:host{font-size:clamp(13px, 0.875rem, 22px)}:host(.chip-soft){--border-radius:10px}:host(.chip-round){--border-radius:999px}:host(.chip-rectangular){--border-radius:0px}";

const chipMdCss = ":host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-inline-flexbox;display:inline-flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:var(--background);color:var(--color);cursor:pointer;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}:host(.chip-disabled){cursor:default;pointer-events:none}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.87);border-radius:var(--border-radius);-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:4px;margin-inline-end:4px;margin-top:4px;margin-bottom:4px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;min-height:32px;font-family:var(--ion-font-family, inherit)}:host(.chip-disabled){opacity:0.4}:host(.ion-color){background:rgba(var(--ion-color-base-rgb), 0.08);color:var(--ion-color-shade)}:host(.ion-color:focus){background:rgba(var(--ion-color-base-rgb), 0.12)}:host(.ion-color.ion-activated){background:rgba(var(--ion-color-base-rgb), 0.16)}@media (any-hover: hover){:host(.ion-color:hover){background:rgba(var(--ion-color-base-rgb), 0.12)}}:host(.chip-outline){border-width:1px;border-style:solid}:host(.chip-outline){border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.32);background:transparent}:host(.chip-outline.ion-color){border-color:rgba(var(--ion-color-base-rgb), 0.32)}:host(.chip-outline:not(.ion-color):focus){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)}:host(.chip-outline.ion-activated:not(.ion-color)){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)}::slotted(ion-icon){font-size:1.4285714286em}:host(:not(.ion-color)) ::slotted(ion-icon){color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54)}::slotted(ion-icon:first-child){-webkit-margin-start:-4px;margin-inline-start:-4px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:-4px;margin-bottom:-4px}::slotted(ion-icon:last-child){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-4px;margin-inline-end:-4px;margin-top:-4px;margin-bottom:-4px}::slotted(ion-avatar){-ms-flex-negative:0;flex-shrink:0;width:1.7142857143em;height:1.7142857143em}::slotted(ion-avatar:first-child){-webkit-margin-start:-8px;margin-inline-start:-8px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:-4px;margin-bottom:-4px}::slotted(ion-avatar:last-child){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-8px;margin-inline-end:-8px;margin-top:-4px;margin-bottom:-4px}:host(:focus){outline:none}:host(:focus){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}:host(.ion-activated){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}@media (any-hover: hover){:host(:hover){--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}:host(.ion-color:hover){background:rgba(var(--ion-color-base-rgb), 0.12)}:host(.chip-outline:not(.ion-color):hover){background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)}}:host{font-size:0.875rem}:host(.chip-soft){--border-radius:8px}:host(.chip-round){--border-radius:999px}:host(.chip-rectangular){--border-radius:0px}";

const Chip = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        /**
         * Display an outline style button.
         */
        this.outline = false;
        /**
         * If `true`, the user cannot interact with the chip.
         */
        this.disabled = false;
        /**
         * Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for
         * a chip with muted, subtle colors.
         *
         * Only applies to the `ionic` theme.
         */
        this.hue = 'subtle';
    }
    /**
     * Set the shape based on the theme
     */
    getShape() {
        const theme = ionicGlobal.getIonTheme(this);
        const { shape } = this;
        if (shape === undefined) {
            return theme === 'ionic' ? 'round' : 'soft';
        }
        return shape;
    }
    getSize() {
        const theme = ionicGlobal.getIonTheme(this);
        const { size } = this;
        if (theme === 'ionic') {
            return size !== undefined ? size : 'large';
            // TODO(ROU-10695): remove the size !== undefined when we add support for
            // the `ios` and `md` themes.
        }
        else if (size !== undefined) {
            index.printIonWarning(`The "${size}" size is not supported in the ${theme} theme.`);
        }
        return undefined;
    }
    render() {
        const { hue } = this;
        const theme$1 = ionicGlobal.getIonTheme(this);
        const size = this.getSize();
        const shape = this.getShape();
        return (index.h(index.Host, { key: 'ec10528929fb43fcae7d2d7c9cc52bcf67d9823e', "aria-disabled": this.disabled ? 'true' : null, class: theme.createColorClasses(this.color, {
                [theme$1]: true,
                [`chip-${shape}`]: true,
                'chip-outline': this.outline,
                'chip-disabled': this.disabled,
                'ion-activatable': true,
                'ion-focusable': !this.disabled,
                [`chip-${size}`]: size !== undefined,
                [`chip-${hue}`]: hue !== undefined,
            }) }, index.h("slot", { key: 'c88e9a90b9de62fded05d4323c5b4f86f2f3e96d' }), theme$1 === 'md' && index.h("ion-ripple-effect", { key: 'f0395345064db0e02cbc886386b07d0d01cb02be' })));
    }
};
Chip.style = {
    ionic: chipIonicCss,
    ios: chipIosCss,
    md: chipMdCss
};

exports.ion_chip = Chip;
