@m3e/dialog 1.1.1 → 1.1.3

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.
package/dist/index.min.js CHANGED
@@ -3,29 +3,29 @@
3
3
  * Copyright (c) 2025 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{LitElement as t,html as e,css as i,nothing as s,unsafeCSS as o}from"lit";import{AttachInternals as n,EventAttribute as r,prefersReducedMotion as a,DesignToken as l,HtmlFor as h}from"@m3e/core";function c(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}function d(t,e,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(t):s?s.value:e.get(t)}function p(t,e,i,s,o){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?o.call(t,i):o?o.value=i:e.set(t,i),i}"function"==typeof SuppressedError&&SuppressedError;
6
+ import{ActionElementBase as t,EventAttribute as e,focusWhenReady as i,DesignToken as s,HtmlFor as o}from"@m3e/core";import{LitElement as n,html as r,unsafeCSS as a,css as l,nothing as h}from"lit";function c(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}function d(t,e,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(t):s?s.value:e.get(t)}function p(t,e,i,s,o){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?o.call(t,i):o?o.value=i:e.set(t,i),i}"function"==typeof SuppressedError&&SuppressedError;
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
11
  */
12
- const u=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},m=globalThis,f=m.ShadowRoot&&(void 0===m.ShadyCSS||m.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$=Symbol(),g=new WeakMap;
12
+ const u=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},m=globalThis,$=m.ShadowRoot&&(void 0===m.ShadyCSS||m.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,f=Symbol(),g=new WeakMap;
13
13
  /**
14
14
  * @license
15
15
  * Copyright 2019 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
- */let v=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==$)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(f&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=g.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&g.set(e,t))}return t}toString(){return this.cssText}};const y=f?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new v("string"==typeof t?t:t+"",void 0,$))(e)})(t):t,{is:_,defineProperty:b,getOwnPropertyDescriptor:A,getOwnPropertyNames:w,getOwnPropertySymbols:E,getPrototypeOf:S}=Object,C=globalThis,x=C.trustedTypes,P=x?x.emptyScript:"",k=C.reactiveElementPolyfillSupport,U=(t,e)=>t,M={toAttribute(t,e){switch(e){case Boolean:t=t?P:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},T=(t,e)=>!_(t,e),O={attribute:!0,type:String,converter:M,reflect:!1,useDefault:!1,hasChanged:T};
17
+ */let y=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==f)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if($&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=g.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&g.set(e,t))}return t}toString(){return this.cssText}};const _=$?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new y("string"==typeof t?t:t+"",void 0,f))(e)})(t):t,{is:v,defineProperty:b,getOwnPropertyDescriptor:A,getOwnPropertyNames:w,getOwnPropertySymbols:E,getPrototypeOf:S}=Object,C=globalThis,x=C.trustedTypes,P=x?x.emptyScript:"",k=C.reactiveElementPolyfillSupport,U=(t,e)=>t,T={toAttribute(t,e){switch(e){case Boolean:t=t?P:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},O=(t,e)=>!v(t,e),M={attribute:!0,type:String,converter:T,reflect:!1,useDefault:!1,hasChanged:O};
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
- */Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;class H extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=O){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&b(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=A(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const n=s?.call(this);o?.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??O}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;const t=S(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){const t=this.properties,e=[...w(t),...E(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(y(t))}else void 0!==t&&e.push(y(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(f)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),s=m.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:M).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:M;this._$Em=s;const n=o.fromAttribute(e,t.type);this[s]=n??this._$Ej?.get(s)??n,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const s=this.constructor,o=this[t];if(i??=s.getPropertyOptions(t),!((i.hasChanged??T)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),!0!==o||void 0!==n)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}H.elementStyles=[],H.shadowRootOptions={mode:"open"},H[U("elementProperties")]=new Map,H[U("finalized")]=new Map,k?.({ReactiveElement:H}),(C.reactiveElementVersions??=[]).push("2.1.1");
22
+ */Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;class H extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=M){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&b(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=A(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const n=s?.call(this);o?.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??M}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;const t=S(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){const t=this.properties,e=[...w(t),...E(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(_(t))}else void 0!==t&&e.push(_(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if($)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),s=m.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:T).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:T;this._$Em=s;const n=o.fromAttribute(e,t.type);this[s]=n??this._$Ej?.get(s)??n,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const s=this.constructor,o=this[t];if(i??=s.getPropertyOptions(t),!((i.hasChanged??O)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),!0!==o||void 0!==n)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}H.elementStyles=[],H.shadowRootOptions={mode:"open"},H[U("elementProperties")]=new Map,H[U("finalized")]=new Map,k?.({ReactiveElement:H}),(C.reactiveElementVersions??=[]).push("2.1.1");
23
23
  /**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
27
  */
28
- const N={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:T},z=(t=N,e,i)=>{const{kind:s,metadata:o}=i;let n=globalThis.litPropertyMetadata.get(o);if(void 0===n&&globalThis.litPropertyMetadata.set(o,n=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),n.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const o=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,o,t)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const o=this[s];e.call(this,i),this.requestUpdate(s,o,t)}}throw Error("Unsupported decorator location: "+s)};function R(t){return(e,i)=>"object"==typeof i?z(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}
28
+ const N={attribute:!0,type:String,converter:T,reflect:!1,hasChanged:O},z=(t=N,e,i)=>{const{kind:s,metadata:o}=i;let n=globalThis.litPropertyMetadata.get(o);if(void 0===n&&globalThis.litPropertyMetadata.set(o,n=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),n.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const o=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,o,t)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const o=this[s];e.call(this,i),this.requestUpdate(s,o,t)}}throw Error("Unsupported decorator location: "+s)};function R(t){return(e,i)=>"object"==typeof i?z(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}
29
29
  /**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
@@ -36,16 +36,16 @@ const N={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:T},z=(t=N,e,
36
36
  * Copyright 2017 Google LLC
37
37
  * SPDX-License-Identifier: BSD-3-Clause
38
38
  */
39
- function j(t,e){return(e,i,s)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}var L;let D=class extends(n(t)){constructor(){super(...arguments),this.returnValue="",L.set(this,t=>{t.defaultPrevented||this.closest("m3e-dialog")?.hide(this.returnValue)})}connectedCallback(){super.connectedCallback(),this.parentElement?.addEventListener("click",d(this,L,"f"))}disconnectedCallback(){super.disconnectedCallback(),this.parentElement?.removeEventListener("click",d(this,L,"f"))}render(){return e`<slot></slot>`}};L=new WeakMap,D.styles=i`:host { display: contents; }`,c([R({attribute:"return-value"})],D.prototype,"returnValue",void 0),D=c([u("m3e-dialog-action")],D);
39
+ function j(t,e){return(e,i,s)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}let L=class extends t{constructor(){super(...arguments),this.returnValue=""}_onClick(){this.closest("m3e-dialog")?.hide(this.returnValue)}};c([R({attribute:"return-value"})],L.prototype,"returnValue",void 0),L=c([u("m3e-dialog-action")],L);
40
40
  /**
41
41
  * @license
42
42
  * Copyright 2017 Google LLC
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
44
  */
45
- const W=globalThis,V=W.trustedTypes,B=V?V.createPolicy("lit-html",{createHTML:t=>t}):void 0,I="$lit$",q=`lit$${Math.random().toFixed(9).slice(2)}$`,Y="?"+q,F=`<${Y}>`,K=document,Z=()=>K.createComment(""),J=t=>null===t||"object"!=typeof t&&"function"!=typeof t,G=Array.isArray,Q="[ \t\n\f\r]",X=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,et=/>/g,it=RegExp(`>|${Q}(?:([^\\s"'>=/]+)(${Q}*=${Q}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),st=/'/g,ot=/"/g,nt=/^(?:script|style|textarea|title)$/i,rt=Symbol.for("lit-noChange"),at=Symbol.for("lit-nothing"),lt=new WeakMap,ht=K.createTreeWalker(K,129);function ct(t,e){if(!G(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==B?B.createHTML(e):e}const dt=(t,e)=>{const i=t.length-1,s=[];let o,n=2===e?"<svg>":3===e?"<math>":"",r=X;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===X?"!--"===l[1]?r=tt:void 0!==l[1]?r=et:void 0!==l[2]?(nt.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=it):void 0!==l[3]&&(r=it):r===it?">"===l[0]?(r=o??X,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?it:'"'===l[3]?ot:st):r===ot||r===st?r=it:r===tt||r===et?r=X:(r=it,o=void 0);const d=r===it&&t[e+1].startsWith("/>")?" ":"";n+=r===X?i+F:h>=0?(s.push(a),i.slice(0,h)+I+i.slice(h)+q+d):i+q+(-2===h?e:d)}return[ct(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};class pt{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const r=t.length-1,a=this.parts,[l,h]=dt(t,e);if(this.el=pt.createElement(l,i),ht.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=ht.nextNode())&&a.length<r;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(I)){const e=h[n++],i=s.getAttribute(t).split(q),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:r[2],strings:i,ctor:"."===r[1]?gt:"?"===r[1]?vt:"@"===r[1]?yt:$t}),s.removeAttribute(t)}else t.startsWith(q)&&(a.push({type:6,index:o}),s.removeAttribute(t));if(nt.test(s.tagName)){const t=s.textContent.split(q),e=t.length-1;if(e>0){s.textContent=V?V.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],Z()),ht.nextNode(),a.push({type:2,index:++o});s.append(t[e],Z())}}}else if(8===s.nodeType)if(s.data===Y)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(q,t+1));)a.push({type:7,index:o}),t+=q.length-1}o++}}static createElement(t,e){const i=K.createElement("template");return i.innerHTML=t,i}}function ut(t,e,i=t,s){if(e===rt)return e;let o=void 0!==s?i._$Co?.[s]:i._$Cl;const n=J(e)?void 0:e._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),void 0===n?o=void 0:(o=new n(t),o._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=o:i._$Cl=o),void 0!==o&&(e=ut(t,o._$AS(t,e.values),o,s)),e}class mt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??K).importNode(e,!0);ht.currentNode=s;let o=ht.nextNode(),n=0,r=0,a=i[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new ft(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new _t(o,this,t)),this._$AV.push(e),a=i[++r]}n!==a?.index&&(o=ht.nextNode(),n++)}return ht.currentNode=K,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class ft{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=at,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ut(this,t,e),J(t)?t===at||null==t||""===t?(this._$AH!==at&&this._$AR(),this._$AH=at):t!==this._$AH&&t!==rt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>G(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==at&&J(this._$AH)?this._$AA.nextSibling.data=t:this.T(K.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=pt.createElement(ct(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new mt(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=lt.get(t.strings);return void 0===e&&lt.set(t.strings,e=new pt(t)),e}k(t){G(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new ft(this.O(Z()),this.O(Z()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class $t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=at,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=at}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(void 0===o)t=ut(this,t,e,0),n=!J(t)||t!==this._$AH&&t!==rt,n&&(this._$AH=t);else{const s=t;let r,a;for(t=o[0],r=0;r<o.length-1;r++)a=ut(this,s[i+r],e,r),a===rt&&(a=this._$AH[r]),n||=!J(a)||a!==this._$AH[r],a===at?t=at:t!==at&&(t+=(a??"")+o[r+1]),this._$AH[r]=a}n&&!s&&this.j(t)}j(t){t===at?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class gt extends $t{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===at?void 0:t}}class vt extends $t{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==at)}}class yt extends $t{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=ut(this,t,e,0)??at)===rt)return;const i=this._$AH,s=t===at&&i!==at||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==at&&(i===at||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class _t{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){ut(this,t)}}const bt=W.litHtmlPolyfillSupport;bt?.(pt,ft),(W.litHtmlVersions??=[]).push("3.3.1");var At,wt,Et,St,Ct,xt,Pt,kt,Ut,Mt,Tt;let Ot=Tt=class extends(r(t,"opening","opened","cancel","closing","closed")){constructor(){super(...arguments),At.add(this),wt.set(this,Tt.__nextId++),Et.set(this,!1),St.set(this,!1),this._hasActions=!1,this.alert=!1,this.dismissible=!1,this.disableClose=!1,this.noFocusTrap=!1,this.closeLabel="Close",this.returnValue=""}get open(){return d(this,Et,"f")}set open(t){t!==d(this,Et,"f")&&(p(this,Et,t,"f"),d(this,Et,"f")?this.show():this.hide())}async show(){if(await this.updateComplete,this._base.open)return;if(!this.dispatchEvent(new Event("opening",{cancelable:!0})))return void(this.open=!1);this._base.showModal(),this._content.scrollTop=0;const t=this.querySelector("[autofocus]");t&&(a()?t.focus():this._base.addEventListener("transitionend",()=>t.focus(),{once:!0})),this.dispatchEvent(new Event("opened"))}async hide(t=this.returnValue){if(!this.isConnected)return void(this.open=!1);if(await this.updateComplete,!this._base.open)return void(this.open=!1);const e=this.returnValue;this.returnValue=t,this.dispatchEvent(new Event("closing",{cancelable:!0}))?(this.open=!1,this._base.close(t),this.dispatchEvent(new Event("closed"))):this.returnValue=e}render(){return e`<dialog class="base" role="${(t=>t??at)(this.alert?"alertdialog":void 0)}" aria-labelledby="m3e-dialog-${d(this,wt,"f")}-header" .returnvalue="${this.returnValue}" @close="${d(this,At,"m",xt)}" @cancel="${d(this,At,"m",Pt)}" @click="${d(this,At,"m",kt)}" @keydown="${d(this,At,"m",Ut)}"><m3e-elevation level="3"></m3e-elevation><m3e-focus-trap ?disabled="${this.noFocusTrap}"><div class="header"><slot name="header" id="m3e-dialog-${d(this,wt,"f")}-header"></slot>${d(this,At,"m",Ct).call(this)}</div><m3e-scroll-container class="content" dividers="${this._hasActions?"above-below":"above"}"><slot></slot></m3e-scroll-container><slot name="actions" @slotchange="${d(this,At,"m",Mt)}"></slot></m3e-focus-trap></dialog>`}};var Ht;wt=new WeakMap,Et=new WeakMap,St=new WeakMap,At=new WeakSet,Ct=function(){return this.dismissible?e`<m3e-icon-button aria-label="${this.closeLabel}" class="close" @click="${this.hide}"><slot name="close-icon"><svg class="close-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg></slot></m3e-icon-button>`:s},xt=function(){d(this,St,"f")&&(p(this,St,!0,"f"),this._base?.dispatchEvent(new Event("cancel",{cancelable:!0})))},Pt=function(t){t.target===this._base&&(p(this,St,!1,"f"),t.preventDefault(),this.dispatchEvent(new Event("cancel",{cancelable:!0}))||this.hide())},kt=function(t){this.disableClose||t.target!==this._base||this.hide()},Ut=function(t){"Escape"!==t.key||t.shiftKey||t.ctrlKey||(t.preventDefault(),this.disableClose||this.hide())},Mt=function(t){this._hasActions=t.target.assignedNodes({flatten:!0}).length>0,this.classList.toggle("-has-actions",this._hasActions)},Ot.styles=i`:host { display: contents; } .base { font: inherit; border: unset; outline: unset; padding: unset; display: flex; flex-direction: column; position: fixed; overflow: visible; border-radius: var(--m3e-dialog-shape, ${l.shape.corner.extraLarge}); min-width: var(--m3e-dialog-min-width, 17.5rem); max-width: var(--m3e-dialog-max-width, 35rem); color: var(--m3e-dialog-color, ${l.color.onSurface}); background-color: var(--m3e-dialog-container-color, ${l.color.surfaceContainerHigh}); visibility: hidden; opacity: 0; transform-origin: top; transform: translateY(-3.125rem) scaleY(0.8); } .base::backdrop { background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${l.color.scrim}) 0%, transparent); margin-inline-end: -20px; } .base:not([open]) { visibility: hidden; opacity: 0; transform: translateY(-3.125rem) scaleY(0.8); transition: ${o(`opacity ${l.motion.duration.short3} ${l.motion.easing.emphasized}, \n transform ${l.motion.duration.short3} ${l.motion.easing.emphasized},\n overlay ${l.motion.duration.short3} ${l.motion.easing.emphasized} allow-discrete,\n visibility ${l.motion.duration.short3} ${l.motion.easing.emphasized} allow-discrete`)}; } .base[open] { visibility: visible; opacity: 1; transform: translateY(0) scaleY(1); transition: ${o(`opacity ${l.motion.duration.long2} ${l.motion.easing.emphasized}, \n transform ${l.motion.duration.long2} ${l.motion.easing.emphasized},\n overlay ${l.motion.duration.long2} ${l.motion.easing.emphasized} allow-discrete,\n visibility ${l.motion.duration.long2} ${l.motion.easing.emphasized} allow-discrete`)}; } .base:not([open])::backdrop { transition: ${o(`background-color ${l.motion.duration.short3} ${l.motion.easing.standard}, \n overlay ${l.motion.duration.short3} ${l.motion.easing.standard} allow-discrete,\n visibility ${l.motion.duration.short3} ${l.motion.easing.standard} allow-discrete`)}; } .base[open]::backdrop { background-color: color-mix( in srgb, var(--m3e-dialog-scrim-color, ${l.color.scrim}) var(--m3e-dialog-scrim-opacity, 32%), transparent ); transition: ${o(`background-color ${l.motion.duration.long2} ${l.motion.easing.standard}, \n overlay ${l.motion.duration.long2} ${l.motion.easing.standard} allow-discrete,\n visibility ${l.motion.duration.long2} ${l.motion.easing.standard} allow-discrete`)}; } @starting-style { .base[open] { opacity: 0; transform: translateY(-3.125rem) scaleY(0.8); } .base[open]::backdrop { background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${l.color.scrim}) 0%, transparent); } } .header { flex: none; display: flex; align-items: center; padding: 1.5rem 1.5rem 1rem 1.5rem; background-color: var(--m3e-dialog-header-container-color, transparent); } ::slotted([slot="header"]) { margin: unset; flex: 1 1 auto; color: var(--m3e-dialog-header-color, inherit); font-size: var(--m3e-dialog-header-font-size, ${l.typescale.standard.headline.small.fontSize}); font-weight: var(--m3e-dialog-header-font-weight, ${l.typescale.standard.headline.small.fontWeight}); line-height: var(--m3e-dialog-header-line-height, ${l.typescale.standard.headline.small.lineHeight}); letter-spacing: var(--m3e-dialog-header-tracking, ${l.typescale.standard.headline.small.tracking}); } .content { padding-inline: 1.5rem; color: var(--m3e-dialog-content-color, ${l.color.onSurfaceVariant}); font-size: var(--m3e-dialog-content-font-size, ${l.typescale.standard.body.medium.fontSize}); font-weight: var(--m3e-dialog-content-font-weight, ${l.typescale.standard.body.medium.fontWeight}); line-height: var(--m3e-dialog-content-line-height, ${l.typescale.standard.body.medium.lineHeight}); letter-spacing: var(--m3e-dialog-content-tracking, ${l.typescale.standard.body.medium.tracking}); } ::slotted([slot="actions"]) { flex: none; display: flex; align-items: center; min-height: 1.5rem; padding: 1.5rem; column-gap: 0.5rem; } ::slotted([slot="actions"][end]) { justify-content: flex-end; } :host(:not(.-has-actions)) .content { margin-bottom: 1.5rem; } .close { margin-inline-start: 0.5rem; } ::slotted([slot="close-icon"]), .close-icon { width: 1em; font-size: var(--m3e-icon-button-icon-size, 1.5rem) !important; } @media (forced-colors: active) { .base:not([open])::backdrop, .base[open]::backdrop { transition: none; } .base { border-style: solid; border-width: 1px; border-color: CanvasText; } } @media (prefers-reduced-motion) { .base:not([open]), .base[open], .base:not([open])::backdrop, .base[open]::backdrop { transition: none; } }`,Ot.__nextId=0,c([function(t){return R({...t,state:!0,attribute:!1})}
45
+ const D=globalThis,V=D.trustedTypes,B=V?V.createPolicy("lit-html",{createHTML:t=>t}):void 0,I="$lit$",W=`lit$${Math.random().toFixed(9).slice(2)}$`,q="?"+W,Y=`<${q}>`,F=document,K=()=>F.createComment(""),Z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,J=Array.isArray,G="[ \t\n\f\r]",Q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,X=/-->/g,tt=/>/g,et=RegExp(`>|${G}(?:([^\\s"'>=/]+)(${G}*=${G}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,st=/"/g,ot=/^(?:script|style|textarea|title)$/i,nt=Symbol.for("lit-noChange"),rt=Symbol.for("lit-nothing"),at=new WeakMap,lt=F.createTreeWalker(F,129);function ht(t,e){if(!J(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==B?B.createHTML(e):e}const ct=(t,e)=>{const i=t.length-1,s=[];let o,n=2===e?"<svg>":3===e?"<math>":"",r=Q;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===Q?"!--"===l[1]?r=X:void 0!==l[1]?r=tt:void 0!==l[2]?(ot.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=et):void 0!==l[3]&&(r=et):r===et?">"===l[0]?(r=o??Q,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?et:'"'===l[3]?st:it):r===st||r===it?r=et:r===X||r===tt?r=Q:(r=et,o=void 0);const d=r===et&&t[e+1].startsWith("/>")?" ":"";n+=r===Q?i+Y:h>=0?(s.push(a),i.slice(0,h)+I+i.slice(h)+W+d):i+W+(-2===h?e:d)}return[ht(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};class dt{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const r=t.length-1,a=this.parts,[l,h]=ct(t,e);if(this.el=dt.createElement(l,i),lt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=lt.nextNode())&&a.length<r;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(I)){const e=h[n++],i=s.getAttribute(t).split(W),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:r[2],strings:i,ctor:"."===r[1]?ft:"?"===r[1]?gt:"@"===r[1]?yt:$t}),s.removeAttribute(t)}else t.startsWith(W)&&(a.push({type:6,index:o}),s.removeAttribute(t));if(ot.test(s.tagName)){const t=s.textContent.split(W),e=t.length-1;if(e>0){s.textContent=V?V.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],K()),lt.nextNode(),a.push({type:2,index:++o});s.append(t[e],K())}}}else if(8===s.nodeType)if(s.data===q)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(W,t+1));)a.push({type:7,index:o}),t+=W.length-1}o++}}static createElement(t,e){const i=F.createElement("template");return i.innerHTML=t,i}}function pt(t,e,i=t,s){if(e===nt)return e;let o=void 0!==s?i._$Co?.[s]:i._$Cl;const n=Z(e)?void 0:e._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),void 0===n?o=void 0:(o=new n(t),o._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=o:i._$Cl=o),void 0!==o&&(e=pt(t,o._$AS(t,e.values),o,s)),e}class ut{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??F).importNode(e,!0);lt.currentNode=s;let o=lt.nextNode(),n=0,r=0,a=i[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new mt(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new _t(o,this,t)),this._$AV.push(e),a=i[++r]}n!==a?.index&&(o=lt.nextNode(),n++)}return lt.currentNode=F,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class mt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=rt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=pt(this,t,e),Z(t)?t===rt||null==t||""===t?(this._$AH!==rt&&this._$AR(),this._$AH=rt):t!==this._$AH&&t!==nt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>J(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==rt&&Z(this._$AH)?this._$AA.nextSibling.data=t:this.T(F.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=dt.createElement(ht(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new ut(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=at.get(t.strings);return void 0===e&&at.set(t.strings,e=new dt(t)),e}k(t){J(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new mt(this.O(K()),this.O(K()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class $t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=rt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=rt}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(void 0===o)t=pt(this,t,e,0),n=!Z(t)||t!==this._$AH&&t!==nt,n&&(this._$AH=t);else{const s=t;let r,a;for(t=o[0],r=0;r<o.length-1;r++)a=pt(this,s[i+r],e,r),a===nt&&(a=this._$AH[r]),n||=!Z(a)||a!==this._$AH[r],a===rt?t=rt:t!==rt&&(t+=(a??"")+o[r+1]),this._$AH[r]=a}n&&!s&&this.j(t)}j(t){t===rt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ft extends $t{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===rt?void 0:t}}class gt extends $t{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==rt)}}class yt extends $t{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=pt(this,t,e,0)??rt)===nt)return;const i=this._$AH,s=t===rt&&i!==rt||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==rt&&(i===rt||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class _t{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){pt(this,t)}}const vt=D.litHtmlPolyfillSupport;vt?.(dt,mt),(D.litHtmlVersions??=[]).push("3.3.1");var bt,At,wt,Et,St,Ct,xt,Pt,kt,Ut,Tt;let Ot=Tt=class extends(e(n,"opening","opened","cancel","closing","closed")){constructor(){super(...arguments),bt.add(this),At.set(this,Tt.__nextId++),wt.set(this,!1),Et.set(this,!1),this._hasActions=!1,this.alert=!1,this.dismissible=!1,this.disableClose=!1,this.noFocusTrap=!1,this.closeLabel="Close",this.returnValue=""}get open(){return d(this,wt,"f")}set open(t){t!==d(this,wt,"f")&&(p(this,wt,t,"f"),d(this,wt,"f")?this.show():this.hide())}async show(){if(await this.updateComplete,this._base.open)return;if(!this.dispatchEvent(new Event("opening",{cancelable:!0})))return void(this.open=!1);this._base.showModal(),this._content.scrollTop=0;const t=this.querySelector("[autofocus]");t&&i(t),this.dispatchEvent(new Event("opened"))}async hide(t=this.returnValue){if(!this.isConnected)return void(this.open=!1);if(await this.updateComplete,!this._base.open)return void(this.open=!1);const e=this.returnValue;this.returnValue=t,this.dispatchEvent(new Event("closing",{cancelable:!0}))?(this.open=!1,this._base.close(t),this.dispatchEvent(new Event("closed"))):this.returnValue=e}render(){return r`<dialog class="base" role="${(t=>t??rt)(this.alert?"alertdialog":void 0)}" aria-labelledby="m3e-dialog-${d(this,At,"f")}-header" .returnvalue="${this.returnValue}" @close="${d(this,bt,"m",Ct)}" @cancel="${d(this,bt,"m",xt)}" @click="${d(this,bt,"m",Pt)}" @keydown="${d(this,bt,"m",kt)}"><m3e-elevation level="3"></m3e-elevation><m3e-focus-trap ?disabled="${this.noFocusTrap}"><div class="header"><slot name="header" id="m3e-dialog-${d(this,At,"f")}-header"></slot>${d(this,bt,"m",St).call(this)}</div><m3e-scroll-container class="content" dividers="${this._hasActions?"above-below":"above"}"><slot></slot></m3e-scroll-container><slot name="actions" @slotchange="${d(this,bt,"m",Ut)}"></slot></m3e-focus-trap></dialog>`}};At=new WeakMap,wt=new WeakMap,Et=new WeakMap,bt=new WeakSet,St=function(){return this.dismissible?r`<m3e-icon-button aria-label="${this.closeLabel}" class="close" @click="${this.hide}"><slot name="close-icon"><svg class="close-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg></slot></m3e-icon-button>`:h},Ct=function(){d(this,Et,"f")&&(p(this,Et,!0,"f"),this._base?.dispatchEvent(new Event("cancel",{cancelable:!0})))},xt=function(t){t.target===this._base&&(p(this,Et,!1,"f"),t.preventDefault(),this.dispatchEvent(new Event("cancel",{cancelable:!0}))||this.hide())},Pt=function(t){this.disableClose||t.target!==this._base||this.hide()},kt=function(t){"Escape"!==t.key||t.shiftKey||t.ctrlKey||(t.preventDefault(),this.disableClose||this.hide())},Ut=function(t){this._hasActions=t.target.assignedNodes({flatten:!0}).length>0,this.classList.toggle("-has-actions",this._hasActions)},Ot.styles=l`:host { display: contents; } .base { font: inherit; border: unset; outline: unset; padding: unset; display: flex; flex-direction: column; position: fixed; overflow: visible; border-radius: var(--m3e-dialog-shape, ${s.shape.corner.extraLarge}); min-width: var(--m3e-dialog-min-width, 17.5rem); max-width: var(--m3e-dialog-max-width, 35rem); color: var(--m3e-dialog-color, ${s.color.onSurface}); background-color: var(--m3e-dialog-container-color, ${s.color.surfaceContainerHigh}); visibility: hidden; opacity: 0; transform-origin: top; transform: translateY(-3.125rem) scaleY(0.8); } .base::backdrop { background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${s.color.scrim}) 0%, transparent); margin-inline-end: -20px; } .base:not([open]) { visibility: hidden; opacity: 0; transform: translateY(-3.125rem) scaleY(0.8); transition: ${a(`opacity ${s.motion.duration.short3} ${s.motion.easing.emphasized}, \n transform ${s.motion.duration.short3} ${s.motion.easing.emphasized},\n overlay ${s.motion.duration.short3} ${s.motion.easing.emphasized} allow-discrete,\n visibility ${s.motion.duration.short3} ${s.motion.easing.emphasized} allow-discrete`)}; } .base[open] { visibility: visible; opacity: 1; transform: translateY(0) scaleY(1); transition: ${a(`opacity ${s.motion.duration.long2} ${s.motion.easing.emphasized}, \n transform ${s.motion.duration.long2} ${s.motion.easing.emphasized},\n overlay ${s.motion.duration.long2} ${s.motion.easing.emphasized} allow-discrete,\n visibility ${s.motion.duration.long2} ${s.motion.easing.emphasized} allow-discrete`)}; } .base:not([open])::backdrop { transition: ${a(`background-color ${s.motion.duration.short3} ${s.motion.easing.standard}, \n overlay ${s.motion.duration.short3} ${s.motion.easing.standard} allow-discrete,\n visibility ${s.motion.duration.short3} ${s.motion.easing.standard} allow-discrete`)}; } .base[open]::backdrop { background-color: color-mix( in srgb, var(--m3e-dialog-scrim-color, ${s.color.scrim}) var(--m3e-dialog-scrim-opacity, 32%), transparent ); transition: ${a(`background-color ${s.motion.duration.long2} ${s.motion.easing.standard}, \n overlay ${s.motion.duration.long2} ${s.motion.easing.standard} allow-discrete,\n visibility ${s.motion.duration.long2} ${s.motion.easing.standard} allow-discrete`)}; } @starting-style { .base[open] { opacity: 0; transform: translateY(-3.125rem) scaleY(0.8); } .base[open]::backdrop { background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${s.color.scrim}) 0%, transparent); } } .header { flex: none; display: flex; align-items: center; padding: 1.5rem 1.5rem 1rem 1.5rem; background-color: var(--m3e-dialog-header-container-color, transparent); } ::slotted([slot="header"]) { margin: unset; flex: 1 1 auto; color: var(--m3e-dialog-header-color, inherit); font-size: var(--m3e-dialog-header-font-size, ${s.typescale.standard.headline.small.fontSize}); font-weight: var(--m3e-dialog-header-font-weight, ${s.typescale.standard.headline.small.fontWeight}); line-height: var(--m3e-dialog-header-line-height, ${s.typescale.standard.headline.small.lineHeight}); letter-spacing: var(--m3e-dialog-header-tracking, ${s.typescale.standard.headline.small.tracking}); } .content { padding-inline: 1.5rem; color: var(--m3e-dialog-content-color, ${s.color.onSurfaceVariant}); font-size: var(--m3e-dialog-content-font-size, ${s.typescale.standard.body.medium.fontSize}); font-weight: var(--m3e-dialog-content-font-weight, ${s.typescale.standard.body.medium.fontWeight}); line-height: var(--m3e-dialog-content-line-height, ${s.typescale.standard.body.medium.lineHeight}); letter-spacing: var(--m3e-dialog-content-tracking, ${s.typescale.standard.body.medium.tracking}); } ::slotted([slot="actions"]) { flex: none; display: flex; align-items: center; min-height: 1.5rem; padding: 1.5rem; column-gap: 0.5rem; } ::slotted([slot="actions"][end]) { justify-content: flex-end; } :host(:not(.-has-actions)) .content { margin-bottom: 1.5rem; } .close { margin-inline-start: 0.5rem; } ::slotted([slot="close-icon"]), .close-icon { width: 1em; font-size: var(--m3e-icon-button-icon-size, 1.5rem) !important; } @media (forced-colors: active) { .base:not([open])::backdrop, .base[open]::backdrop { transition: none; } .base { border-style: solid; border-width: 1px; border-color: CanvasText; } } @media (prefers-reduced-motion) { .base:not([open]), .base[open], .base:not([open])::backdrop, .base[open]::backdrop { transition: none; } }`,Ot.__nextId=0,c([function(t){return R({...t,state:!0,attribute:!1})}
46
46
  /**
47
47
  * @license
48
48
  * Copyright 2017 Google LLC
49
49
  * SPDX-License-Identifier: BSD-3-Clause
50
- */()],Ot.prototype,"_hasActions",void 0),c([j(".base")],Ot.prototype,"_base",void 0),c([j(".content")],Ot.prototype,"_content",void 0),c([R({type:Boolean})],Ot.prototype,"alert",void 0),c([R({type:Boolean,reflect:!0})],Ot.prototype,"open",null),c([R({type:Boolean})],Ot.prototype,"dismissible",void 0),c([R({attribute:"disable-close",type:Boolean})],Ot.prototype,"disableClose",void 0),c([R({attribute:"no-focus-trap",type:Boolean})],Ot.prototype,"noFocusTrap",void 0),c([R({attribute:"close-label"})],Ot.prototype,"closeLabel",void 0),Ot=Tt=c([u("m3e-dialog")],Ot);let Nt=class extends(h(n(t))){constructor(){super(...arguments),Ht.set(this,t=>{!t.defaultPrevented&&this.control instanceof Ot&&this.control.show()})}connectedCallback(){super.connectedCallback(),this.parentElement&&(this.parentElement.addEventListener("click",d(this,Ht,"f")),this.parentElement.ariaHasPopup="dialog")}disconnectedCallback(){super.disconnectedCallback(),this.parentElement&&(this.parentElement.removeEventListener("click",d(this,Ht,"f")),this.parentElement.ariaHasPopup=null)}render(){return e`<slot></slot>`}};Ht=new WeakMap,Nt.styles=i`:host { display: contents; }`,Nt=c([u("m3e-dialog-trigger")],Nt);export{D as M3eDialogActionElement,Ot as M3eDialogElement,Nt as M3eDialogTriggerElement};
50
+ */()],Ot.prototype,"_hasActions",void 0),c([j(".base")],Ot.prototype,"_base",void 0),c([j(".content")],Ot.prototype,"_content",void 0),c([R({type:Boolean})],Ot.prototype,"alert",void 0),c([R({type:Boolean,reflect:!0})],Ot.prototype,"open",null),c([R({type:Boolean})],Ot.prototype,"dismissible",void 0),c([R({attribute:"disable-close",type:Boolean})],Ot.prototype,"disableClose",void 0),c([R({attribute:"no-focus-trap",type:Boolean})],Ot.prototype,"noFocusTrap",void 0),c([R({attribute:"close-label"})],Ot.prototype,"closeLabel",void 0),Ot=Tt=c([u("m3e-dialog")],Ot);let Mt=class extends(o(t)){connectedCallback(){super.connectedCallback(),this.parentElement&&(this.parentElement.ariaHasPopup="dialog")}disconnectedCallback(){super.disconnectedCallback(),this.parentElement&&(this.parentElement.ariaHasPopup=null)}_onClick(){this.control instanceof Ot&&this.control.show()}};Mt=c([u("m3e-dialog-trigger")],Mt);export{L as M3eDialogActionElement,Ot as M3eDialogElement,Mt as M3eDialogTriggerElement};
51
51
  //# sourceMappingURL=index.min.js.map