/**
 * Copyright IBM Corp. 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

import "../../globals/settings.js";
import { carbonElement } from "../../globals/decorators/carbon-element.js";
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.126.0/helpers/decorate.js";
import "./defs.js";
import inline_notification_default from "./inline-notification.js";
import toast_notification_default$1 from "./toast-notification.scss.js";
import { html } from "lit";
import { property } from "lit/decorators.js";
//#region src/components/notification/toast-notification.ts
/**
* Copyright IBM Corp. 2019, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Toast notification.
*
* @element cds-toast-notification
* @slot subtitle - The subtitle.
* @slot title - The title.
* @fires cds-notification-beingclosed
*   The custom event fired before this notification is being closed upon a user gesture.
*   Cancellation of this event stops the user-initiated action of closing this notification.
* @fires cds-notification-closed - The custom event fired after this notification is closed upon a user gesture.
*/
let CDSToastNotification = class CDSToastNotification extends inline_notification_default {
	constructor(..._args) {
		super(..._args);
		this._type = "toast";
		this.caption = "";
	}
	_renderText() {
		const { caption, subtitle, title, _type: type } = this;
		return html`
      <div class="${"cds"}--${type}-notification__title">
        ${title}<slot name="title"></slot>
      </div>
      <div class="${"cds"}--${type}-notification__subtitle">
        ${subtitle}<slot name="subtitle"></slot>
      </div>
      ${caption || this.querySelector("[slot=\"caption\"]") ? html`
            <div class="${"cds"}--${type}-notification__caption">
              ${caption}<slot name="caption"></slot>
            </div>
          ` : null}
      <slot></slot>
    `;
	}
	render() {
		const { _type: type } = this;
		return html`
      ${this._renderIcon()}
      <div class="${"cds"}--${type}-notification__details">
        ${this._renderText()}
      </div>
      ${this._renderButton()}
    `;
	}
	static {
		this.styles = toast_notification_default$1;
	}
};
__decorate([property()], CDSToastNotification.prototype, "caption", void 0);
CDSToastNotification = __decorate([carbonElement(`cds-toast-notification`)], CDSToastNotification);
var toast_notification_default = CDSToastNotification;
//#endregion
export { toast_notification_default as default };

//# sourceMappingURL=toast-notification.js.map