@nuralyui/toast 0.0.12 → 0.0.13
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/bundle.js +7 -438
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,454 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
const t=window,s=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new WeakMap;class e{constructor(t,s,o){if(this._$cssResult$=!0,o!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o;const i=this.t;if(s&&void 0===t){const s=void 0!==i&&1===i.length;s&&(t=o.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&o.set(i,t))}return t}toString(){return this.cssText}}const n=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let s="";for(const i of t.cssRules)s+=i.cssText;return(t=>new e("string"==typeof t?t:t+"",void 0,i))(s)})(t):t
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2017 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var r;const a=window,l=a.trustedTypes,h=l?l.emptyScript:"",c=a.reactiveElementPolyfillSupport,u={toAttribute(t,s){switch(s){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){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}},d=(t,s)=>s!==t&&(s==s||t==t),v={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:d},f="finalized";class p extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var s;this.finalize(),(null!==(s=this.h)&&void 0!==s?s:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((s,i)=>{const o=this._$Ep(i,s);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,s=v){if(s.state&&(s.attribute=!1),this.finalize(),this.elementProperties.set(t,s),!s.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,s);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,s,i){return{get(){return this[s]},set(o){const e=this[t];this[s]=o,this.requestUpdate(t,e,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||v}static finalize(){if(this.hasOwnProperty(f))return!1;this[f]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,s=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of s)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)s.unshift(n(t))}else void 0!==t&&s.push(n(t));return s}static _$Ep(t,s){const i=s.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var s,i;(null!==(s=this._$ES)&&void 0!==s?s:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var s;null===(s=this._$ES)||void 0===s||s.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,s)=>{this.hasOwnProperty(s)&&(this._$Ei.set(s,this[s]),delete this[s])}))}createRenderRoot(){var i;const o=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,o)=>{s?i.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((s=>{const o=document.createElement("style"),e=t.litNonce;void 0!==e&&o.setAttribute("nonce",e),o.textContent=s.cssText,i.appendChild(o)}))})(o,this.constructor.elementStyles),o}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var s;return null===(s=t.hostConnected)||void 0===s?void 0:s.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var s;return null===(s=t.hostDisconnected)||void 0===s?void 0:s.call(t)}))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EO(t,s,i=v){var o;const e=this.constructor._$Ep(t,i);if(void 0!==e&&!0===i.reflect){const n=(void 0!==(null===(o=i.converter)||void 0===o?void 0:o.toAttribute)?i.converter:u).toAttribute(s,i.type);this._$El=t,null==n?this.removeAttribute(e):this.setAttribute(e,n),this._$El=null}}_$AK(t,s){var i;const o=this.constructor,e=o._$Ev.get(t);if(void 0!==e&&this._$El!==e){const t=o.getPropertyOptions(e),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:u;this._$El=e,this[e]=n.fromAttribute(s,t.type),this._$El=null}}requestUpdate(t,s,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||d)(this[t],s)?(this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,s)=>this[s]=t)),this._$Ei=void 0);let s=!1;const i=this._$AL;try{s=this.shouldUpdate(i),s?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var s;return null===(s=t.hostUpdate)||void 0===s?void 0:s.call(t)})),this.update(i)):this._$Ek()}catch(t){throw s=!1,this._$Ek(),t}s&&this._$AE(i)}willUpdate(t){}_$AE(t){var s;null===(s=this._$ES)||void 0===s||s.forEach((t=>{var s;return null===(s=t.hostUpdated)||void 0===s?void 0:s.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,s)=>this._$EO(s,this[s],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
|
|
12
|
-
/**
|
|
13
|
-
* @license
|
|
14
|
-
* Copyright 2017 Google LLC
|
|
15
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
-
*/
|
|
17
|
-
var y;p[f]=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==c||c({ReactiveElement:p}),(null!==(r=a.reactiveElementVersions)&&void 0!==r?r:a.reactiveElementVersions=[]).push("1.6.3");const m=window,g=m.trustedTypes,b=g?g.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",$=`lit$${(Math.random()+"").slice(9)}$`,x="?"+$,_=`<${x}>`,k=document,A=()=>k.createComment(""),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,E=t=>C(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),T="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,U=/-->/g,M=/>/g,O=RegExp(`>|${T}(?:([^\\s"'>=/]+)(${T}*=${T}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,z=/"/g,R=/^(?:script|style|textarea|title)$/i,N=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),P=new WeakMap,X=k.createTreeWalker(k,129,null,!1);function L(t,s){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==b?b.createHTML(s):s}const q=(t,s)=>{const i=t.length-1,o=[];let e,n=2===s?"<svg>":"",r=j;for(let s=0;s<i;s++){const i=t[s];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===j?"!--"===l[1]?r=U:void 0!==l[1]?r=M:void 0!==l[2]?(R.test(l[2])&&(e=RegExp("</"+l[2],"g")),r=O):void 0!==l[3]&&(r=O):r===O?">"===l[0]?(r=null!=e?e:j,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?O:'"'===l[3]?z:D):r===z||r===D?r=O:r===U||r===M?r=j:(r=O,e=void 0);const u=r===O&&t[s+1].startsWith("/>")?" ":"";n+=r===j?i+_:h>=0?(o.push(a),i.slice(0,h)+w+i.slice(h)+$+u):i+$+(-2===h?(o.push(void 0),s):u)}return[L(t,n+(t[i]||"<?>")+(2===s?"</svg>":"")),o]};class H{constructor({strings:t,_$litType$:s},i){let o;this.parts=[];let e=0,n=0;const r=t.length-1,a=this.parts,[l,h]=q(t,s);if(this.el=H.createElement(l,i),X.currentNode=this.el.content,2===s){const t=this.el.content,s=t.firstChild;s.remove(),t.append(...s.childNodes)}for(;null!==(o=X.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const s of o.getAttributeNames())if(s.endsWith(w)||s.startsWith($)){const i=h[n++];if(t.push(s),void 0!==i){const t=o.getAttribute(i.toLowerCase()+w).split($),s=/([.?@])?(.*)/.exec(i);a.push({type:1,index:e,name:s[2],strings:t,ctor:"."===s[1]?W:"?"===s[1]?Z:"@"===s[1]?J:F})}else a.push({type:6,index:e})}for(const s of t)o.removeAttribute(s)}if(R.test(o.tagName)){const t=o.textContent.split($),s=t.length-1;if(s>0){o.textContent=g?g.emptyScript:"";for(let i=0;i<s;i++)o.append(t[i],A()),X.nextNode(),a.push({type:2,index:++e});o.append(t[s],A())}}}else if(8===o.nodeType)if(o.data===x)a.push({type:2,index:e});else{let t=-1;for(;-1!==(t=o.data.indexOf($,t+1));)a.push({type:7,index:e}),t+=$.length-1}e++}}static createElement(t,s){const i=k.createElement("template");return i.innerHTML=t,i}}function K(t,s,i=t,o){var e,n,r,a;if(s===N)return s;let l=void 0!==o?null===(e=i._$Co)||void 0===e?void 0:e[o]:i._$Cl;const h=S(s)?void 0:s._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,o)),void 0!==o?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:i._$Cl=l),void 0!==l&&(s=K(t,l._$AS(t,s.values),l,o)),s}class V{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var s;const{el:{content:i},parts:o}=this._$AD,e=(null!==(s=null==t?void 0:t.creationScope)&&void 0!==s?s:k).importNode(i,!0);X.currentNode=e;let n=X.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let s;2===l.type?s=new B(n,n.nextSibling,this,t):1===l.type?s=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(s=new G(n,this,t)),this._$AV.push(s),l=o[++a]}r!==(null==l?void 0:l.index)&&(n=X.nextNode(),r++)}return X.currentNode=k,e}v(t){let s=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,s),s+=i.strings.length-2):i._$AI(t[s])),s++}}class B{constructor(t,s,i,o){var e;this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=o,this._$Cp=null===(e=null==o?void 0:o.isConnected)||void 0===e||e}get _$AU(){var t,s;return null!==(s=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==s?s:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const s=this._$AM;return void 0!==s&&11===(null==t?void 0:t.nodeType)&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=K(this,t,s),S(t)?t===I||null==t||""===t?(this._$AH!==I&&this._$AR(),this._$AH=I):t!==this._$AH&&t!==N&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):E(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==I&&S(this._$AH)?this._$AA.nextSibling.data=t:this.$(k.createTextNode(t)),this._$AH=t}g(t){var s;const{values:i,_$litType$:o}=t,e="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=H.createElement(L(o.h,o.h[0]),this.options)),o);if((null===(s=this._$AH)||void 0===s?void 0:s._$AD)===e)this._$AH.v(i);else{const t=new V(e,this),s=t.u(this.options);t.v(i),this.$(s),this._$AH=t}}_$AC(t){let s=P.get(t.strings);return void 0===s&&P.set(t.strings,s=new H(t)),s}T(t){C(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,o=0;for(const e of t)o===s.length?s.push(i=new B(this.k(A()),this.k(A()),this,this.options)):i=s[o],i._$AI(e),o++;o<s.length&&(this._$AR(i&&i._$AB.nextSibling,o),s.length=o)}_$AR(t=this._$AA.nextSibling,s){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,s);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var s;void 0===this._$AM&&(this._$Cp=t,null===(s=this._$AP)||void 0===s||s.call(this,t))}}class F{constructor(t,s,i,o,e){this.type=1,this._$AH=I,this._$AN=void 0,this.element=t,this.name=s,this._$AM=o,this.options=e,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=I}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,s=this,i,o){const e=this.strings;let n=!1;if(void 0===e)t=K(this,t,s,0),n=!S(t)||t!==this._$AH&&t!==N,n&&(this._$AH=t);else{const o=t;let r,a;for(t=e[0],r=0;r<e.length-1;r++)a=K(this,o[i+r],s,r),a===N&&(a=this._$AH[r]),n||(n=!S(a)||a!==this._$AH[r]),a===I?t=I:t!==I&&(t+=(null!=a?a:"")+e[r+1]),this._$AH[r]=a}n&&!o&&this.j(t)}j(t){t===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends F{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===I?void 0:t}}const Y=g?g.emptyScript:"";class Z extends F{constructor(){super(...arguments),this.type=4}j(t){t&&t!==I?this.element.setAttribute(this.name,Y):this.element.removeAttribute(this.name)}}class J extends F{constructor(t,s,i,o,e){super(t,s,i,o,e),this.type=5}_$AI(t,s=this){var i;if((t=null!==(i=K(this,t,s,0))&&void 0!==i?i:I)===N)return;const o=this._$AH,e=t===I&&o!==I||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==I&&(o===I||e);e&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var s,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(s=this.options)||void 0===s?void 0:s.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class G{constructor(t,s,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){K(this,t)}}const Q={O:w,P:$,A:x,C:1,M:q,L:V,R:E,D:K,I:B,V:F,H:Z,N:J,U:W,F:G},tt=m.litHtmlPolyfillSupport;
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2017 Google LLC
|
|
21
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/
|
|
23
|
-
var st;null==tt||tt(H,B),(null!==(y=m.litHtmlVersions)&&void 0!==y?y:m.litHtmlVersions=[]).push("2.8.0");const it=window,ot=it.trustedTypes,et=ot?ot.createPolicy("lit-html",{createHTML:t=>t}):void 0,nt="$lit$",rt=`lit$${(Math.random()+"").slice(9)}$`,at="?"+rt,lt=`<${at}>`,ht=document,ct=()=>ht.createComment(""),ut=t=>null===t||"object"!=typeof t&&"function"!=typeof t,dt=Array.isArray,vt="[ \t\n\f\r]",ft=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pt=/-->/g,yt=/>/g,mt=RegExp(`>|${vt}(?:([^\\s"'>=/]+)(${vt}*=${vt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),gt=/'/g,bt=/"/g,wt=/^(?:script|style|textarea|title)$/i,$t=(t=>(s,...i)=>({_$litType$:t,strings:s,values:i}))(1),xt=Symbol.for("lit-noChange"),_t=Symbol.for("lit-nothing"),kt=new WeakMap,At=ht.createTreeWalker(ht,129,null,!1);function St(t,s){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==et?et.createHTML(s):s}const Ct=(t,s)=>{const i=t.length-1,o=[];let e,n=2===s?"<svg>":"",r=ft;for(let s=0;s<i;s++){const i=t[s];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===ft?"!--"===l[1]?r=pt:void 0!==l[1]?r=yt:void 0!==l[2]?(wt.test(l[2])&&(e=RegExp("</"+l[2],"g")),r=mt):void 0!==l[3]&&(r=mt):r===mt?">"===l[0]?(r=null!=e?e:ft,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?mt:'"'===l[3]?bt:gt):r===bt||r===gt?r=mt:r===pt||r===yt?r=ft:(r=mt,e=void 0);const u=r===mt&&t[s+1].startsWith("/>")?" ":"";n+=r===ft?i+lt:h>=0?(o.push(a),i.slice(0,h)+nt+i.slice(h)+rt+u):i+rt+(-2===h?(o.push(void 0),s):u)}return[St(t,n+(t[i]||"<?>")+(2===s?"</svg>":"")),o]};class Et{constructor({strings:t,_$litType$:s},i){let o;this.parts=[];let e=0,n=0;const r=t.length-1,a=this.parts,[l,h]=Ct(t,s);if(this.el=Et.createElement(l,i),At.currentNode=this.el.content,2===s){const t=this.el.content,s=t.firstChild;s.remove(),t.append(...s.childNodes)}for(;null!==(o=At.nextNode())&&a.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const s of o.getAttributeNames())if(s.endsWith(nt)||s.startsWith(rt)){const i=h[n++];if(t.push(s),void 0!==i){const t=o.getAttribute(i.toLowerCase()+nt).split(rt),s=/([.?@])?(.*)/.exec(i);a.push({type:1,index:e,name:s[2],strings:t,ctor:"."===s[1]?Ot:"?"===s[1]?zt:"@"===s[1]?Rt:Mt})}else a.push({type:6,index:e})}for(const s of t)o.removeAttribute(s)}if(wt.test(o.tagName)){const t=o.textContent.split(rt),s=t.length-1;if(s>0){o.textContent=ot?ot.emptyScript:"";for(let i=0;i<s;i++)o.append(t[i],ct()),At.nextNode(),a.push({type:2,index:++e});o.append(t[s],ct())}}}else if(8===o.nodeType)if(o.data===at)a.push({type:2,index:e});else{let t=-1;for(;-1!==(t=o.data.indexOf(rt,t+1));)a.push({type:7,index:e}),t+=rt.length-1}e++}}static createElement(t,s){const i=ht.createElement("template");return i.innerHTML=t,i}}function Tt(t,s,i=t,o){var e,n,r,a;if(s===xt)return s;let l=void 0!==o?null===(e=i._$Co)||void 0===e?void 0:e[o]:i._$Cl;const h=ut(s)?void 0:s._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,o)),void 0!==o?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[o]=l:i._$Cl=l),void 0!==l&&(s=Tt(t,l._$AS(t,s.values),l,o)),s}class jt{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var s;const{el:{content:i},parts:o}=this._$AD,e=(null!==(s=null==t?void 0:t.creationScope)&&void 0!==s?s:ht).importNode(i,!0);At.currentNode=e;let n=At.nextNode(),r=0,a=0,l=o[0];for(;void 0!==l;){if(r===l.index){let s;2===l.type?s=new Ut(n,n.nextSibling,this,t):1===l.type?s=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(s=new Nt(n,this,t)),this._$AV.push(s),l=o[++a]}r!==(null==l?void 0:l.index)&&(n=At.nextNode(),r++)}return At.currentNode=ht,e}v(t){let s=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,s),s+=i.strings.length-2):i._$AI(t[s])),s++}}class Ut{constructor(t,s,i,o){var e;this.type=2,this._$AH=_t,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=o,this._$Cp=null===(e=null==o?void 0:o.isConnected)||void 0===e||e}get _$AU(){var t,s;return null!==(s=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==s?s:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const s=this._$AM;return void 0!==s&&11===(null==t?void 0:t.nodeType)&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=Tt(this,t,s),ut(t)?t===_t||null==t||""===t?(this._$AH!==_t&&this._$AR(),this._$AH=_t):t!==this._$AH&&t!==xt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>dt(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==_t&&ut(this._$AH)?this._$AA.nextSibling.data=t:this.$(ht.createTextNode(t)),this._$AH=t}g(t){var s;const{values:i,_$litType$:o}=t,e="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=Et.createElement(St(o.h,o.h[0]),this.options)),o);if((null===(s=this._$AH)||void 0===s?void 0:s._$AD)===e)this._$AH.v(i);else{const t=new jt(e,this),s=t.u(this.options);t.v(i),this.$(s),this._$AH=t}}_$AC(t){let s=kt.get(t.strings);return void 0===s&&kt.set(t.strings,s=new Et(t)),s}T(t){dt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,o=0;for(const e of t)o===s.length?s.push(i=new Ut(this.k(ct()),this.k(ct()),this,this.options)):i=s[o],i._$AI(e),o++;o<s.length&&(this._$AR(i&&i._$AB.nextSibling,o),s.length=o)}_$AR(t=this._$AA.nextSibling,s){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,s);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var s;void 0===this._$AM&&(this._$Cp=t,null===(s=this._$AP)||void 0===s||s.call(this,t))}}class Mt{constructor(t,s,i,o,e){this.type=1,this._$AH=_t,this._$AN=void 0,this.element=t,this.name=s,this._$AM=o,this.options=e,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=_t}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,s=this,i,o){const e=this.strings;let n=!1;if(void 0===e)t=Tt(this,t,s,0),n=!ut(t)||t!==this._$AH&&t!==xt,n&&(this._$AH=t);else{const o=t;let r,a;for(t=e[0],r=0;r<e.length-1;r++)a=Tt(this,o[i+r],s,r),a===xt&&(a=this._$AH[r]),n||(n=!ut(a)||a!==this._$AH[r]),a===_t?t=_t:t!==_t&&(t+=(null!=a?a:"")+e[r+1]),this._$AH[r]=a}n&&!o&&this.j(t)}j(t){t===_t?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Ot extends Mt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===_t?void 0:t}}const Dt=ot?ot.emptyScript:"";class zt extends Mt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==_t?this.element.setAttribute(this.name,Dt):this.element.removeAttribute(this.name)}}class Rt extends Mt{constructor(t,s,i,o,e){super(t,s,i,o,e),this.type=5}_$AI(t,s=this){var i;if((t=null!==(i=Tt(this,t,s,0))&&void 0!==i?i:_t)===xt)return;const o=this._$AH,e=t===_t&&o!==_t||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==_t&&(o===_t||e);e&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var s,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(s=this.options)||void 0===s?void 0:s.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class Nt{constructor(t,s,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Tt(this,t)}}const It=it.litHtmlPolyfillSupport;null==It||It(Et,Ut),(null!==(st=it.litHtmlVersions)&&void 0!==st?st:it.litHtmlVersions=[]).push("2.8.0");
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2017 Google LLC
|
|
27
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
-
*/
|
|
29
|
-
var Pt,Xt;class Lt extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,s;const i=super.createRenderRoot();return null!==(t=(s=this.renderOptions).renderBefore)&&void 0!==t||(s.renderBefore=i.firstChild),i}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,s,i)=>{var o,e;const n=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:s;let r=n._$litPart$;if(void 0===r){const t=null!==(e=null==i?void 0:i.renderBefore)&&void 0!==e?e:null;n._$litPart$=r=new Ut(s.insertBefore(ct(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(s,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return xt}}Lt.finalized=!0,Lt._$litElement$=!0,null===(Pt=globalThis.litElementHydrateSupport)||void 0===Pt||Pt.call(globalThis,{LitElement:Lt});const qt=globalThis.litElementPolyfillSupport;null==qt||qt({LitElement:Lt}),(null!==(Xt=globalThis.litElementVersions)&&void 0!==Xt?Xt:globalThis.litElementVersions=[]).push("3.3.3");
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2017 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/
|
|
35
|
-
const Ht=(t,s)=>"method"===s.kind&&s.descriptor&&!("value"in s.descriptor)?{...s,finisher(i){i.createProperty(s.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:s.key,initializer(){"function"==typeof s.initializer&&(this[s.key]=s.initializer.call(this))},finisher(i){i.createProperty(s.key,t)}},Kt=(t,s,i)=>{s.constructor.createProperty(i,t)};
|
|
36
|
-
/**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2017 Google LLC
|
|
39
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/function Vt(t){return(s,i)=>void 0!==i?Kt(t,s,i):Ht(t,s)
|
|
41
|
-
/**
|
|
42
|
-
* @license
|
|
43
|
-
* Copyright 2017 Google LLC
|
|
44
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/}
|
|
46
|
-
/**
|
|
47
|
-
* @license
|
|
48
|
-
* Copyright 2021 Google LLC
|
|
49
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/
|
|
51
|
-
var Bt;null===(Bt=window.HTMLSlotElement)||void 0===Bt||Bt.prototype.assignedElements;
|
|
52
|
-
/**
|
|
53
|
-
* @license
|
|
54
|
-
* Copyright 2017 Google LLC
|
|
55
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
56
|
-
*/
|
|
57
|
-
const Ft=1,Wt=2,Yt=t=>(...s)=>({_$litDirective$:t,values:s});class Zt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,s,i){this._$Ct=t,this._$AM=s,this._$Ci=i}_$AS(t,s){return this.update(t,s)}update(t,s){return this.render(...s)}}
|
|
58
|
-
/**
|
|
59
|
-
* @license
|
|
60
|
-
* Copyright 2020 Google LLC
|
|
61
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/const{I:Jt}=Q,Gt=()=>document.createComment(""),Qt=(t,s,i)=>{var o;const e=t._$AA.parentNode,n=void 0===s?t._$AB:s._$AA;if(void 0===i){const s=e.insertBefore(Gt(),n),o=e.insertBefore(Gt(),n);i=new Jt(s,o,t,t.options)}else{const s=i._$AB.nextSibling,r=i._$AM,a=r!==t;if(a){let s;null===(o=i._$AQ)||void 0===o||o.call(i,t),i._$AM=t,void 0!==i._$AP&&(s=t._$AU)!==r._$AU&&i._$AP(s)}if(s!==n||a){let t=i._$AA;for(;t!==s;){const s=t.nextSibling;e.insertBefore(t,n),t=s}}}return i},ts=(t,s,i=t)=>(t._$AI(s,i),t),ss={},is=(t,s=ss)=>t._$AH=s,os=t=>{var s;null===(s=t._$AP)||void 0===s||s.call(t,!1,!0);let i=t._$AA;const o=t._$AB.nextSibling;for(;i!==o;){const t=i.nextSibling;i.remove(),i=t}},es=(t,s,i)=>{const o=new Map;for(let e=s;e<=i;e++)o.set(t[e],e);return o},ns=Yt(class extends Zt{constructor(t){if(super(t),t.type!==Wt)throw Error("repeat() can only be used in text expressions")}ct(t,s,i){let o;void 0===i?i=s:void 0!==s&&(o=s);const e=[],n=[];let r=0;for(const s of t)e[r]=o?o(s,r):r,n[r]=i(s,r),r++;return{values:n,keys:e}}render(t,s,i){return this.ct(t,s,i).values}update(t,[s,i,o]){var e;const n=(t=>t._$AH)(t),{values:r,keys:a}=this.ct(s,i,o);if(!Array.isArray(n))return this.ut=a,r;const l=null!==(e=this.ut)&&void 0!==e?e:this.ut=[],h=[];let c,u,d=0,v=n.length-1,f=0,p=r.length-1;for(;d<=v&&f<=p;)if(null===n[d])d++;else if(null===n[v])v--;else if(l[d]===a[f])h[f]=ts(n[d],r[f]),d++,f++;else if(l[v]===a[p])h[p]=ts(n[v],r[p]),v--,p--;else if(l[d]===a[p])h[p]=ts(n[d],r[p]),Qt(t,h[p+1],n[d]),d++,p--;else if(l[v]===a[f])h[f]=ts(n[v],r[f]),Qt(t,n[d],n[v]),v--,f++;else if(void 0===c&&(c=es(a,f,p),u=es(l,d,v)),c.has(l[d]))if(c.has(l[v])){const s=u.get(a[f]),i=void 0!==s?n[s]:null;if(null===i){const s=Qt(t,n[d]);ts(s,r[f]),h[f]=s}else h[f]=ts(i,r[f]),Qt(t,n[d],i),n[s]=null;f++}else os(n[v]),v--;else os(n[d]),d++;for(;f<=p;){const s=Qt(t,h[p+1]);ts(s,r[f]),h[f++]=s}for(;d<=v;){const t=n[d++];null!==t&&os(t)}return this.ut=a,is(t,h),N}}),rs=Yt(class extends Zt{constructor(t){var s;if(super(t),t.type!==Ft||"class"!==t.name||(null===(s=t.strings)||void 0===s?void 0:s.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(t,[s]){var i,o;if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in s)s[t]&&!(null===(i=this.nt)||void 0===i?void 0:i.has(t))&&this.it.add(t);return this.render(s)}const e=t.element.classList;this.it.forEach((t=>{t in s||(e.remove(t),this.it.delete(t))}));for(const t in s){const i=!!s[t];i===this.it.has(t)||(null===(o=this.nt)||void 0===o?void 0:o.has(t))||(i?(e.add(t),this.it.add(t)):(e.remove(t),this.it.delete(t)))}return N}}),as=((t,...s)=>{const o=1===t.length?t[0]:s.reduce(((s,i,o)=>s+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new e(o,t,i)})`
|
|
63
|
-
:host {
|
|
64
|
-
display: block;
|
|
65
|
-
position: fixed;
|
|
66
|
-
z-index: var(--nuraly-z-index-toast);
|
|
67
|
-
pointer-events: none;
|
|
68
|
-
|
|
69
|
-
/* Force CSS custom property inheritance to ensure theme switching works properly */
|
|
70
|
-
color: var(--nuraly-color-text);
|
|
71
|
-
font-family: var(--nuraly-font-family);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* Container positioning */
|
|
75
|
-
:host([position="top-right"]) {
|
|
76
|
-
top: var(--nuraly-spacing-4);
|
|
77
|
-
right: var(--nuraly-spacing-4);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
:host([position="top-left"]) {
|
|
81
|
-
top: var(--nuraly-spacing-4);
|
|
82
|
-
left: var(--nuraly-spacing-4);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
:host([position="top-center"]) {
|
|
86
|
-
top: var(--nuraly-spacing-4);
|
|
87
|
-
left: 50%;
|
|
88
|
-
transform: translateX(-50%);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
:host([position="bottom-right"]) {
|
|
92
|
-
bottom: var(--nuraly-spacing-4);
|
|
93
|
-
right: var(--nuraly-spacing-4);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
:host([position="bottom-left"]) {
|
|
97
|
-
bottom: var(--nuraly-spacing-4);
|
|
98
|
-
left: var(--nuraly-spacing-4);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
:host([position="bottom-center"]) {
|
|
102
|
-
bottom: var(--nuraly-spacing-4);
|
|
103
|
-
left: 50%;
|
|
104
|
-
transform: translateX(-50%);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.toast-container {
|
|
108
|
-
display: flex;
|
|
109
|
-
flex-direction: column;
|
|
110
|
-
gap: var(--nuraly-toast-stack-gap);
|
|
111
|
-
min-width: var(--nuraly-toast-min-width);
|
|
112
|
-
max-width: var(--nuraly-toast-max-width);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.toast {
|
|
116
|
-
display: flex;
|
|
117
|
-
align-items: start;
|
|
118
|
-
gap: var(--nuraly-toast-gap);
|
|
119
|
-
padding: var(--nuraly-toast-padding-vertical) var(--nuraly-toast-padding-horizontal);
|
|
120
|
-
background-color: var(--nuraly-color-background);
|
|
121
|
-
color: var(--nuraly-color-text);
|
|
122
|
-
border: 1px solid var(--nuraly-color-border);
|
|
123
|
-
border-radius: var(--nuraly-border-radius-toast);
|
|
124
|
-
box-shadow: var(--nuraly-shadow-toast);
|
|
125
|
-
pointer-events: auto;
|
|
126
|
-
cursor: default;
|
|
127
|
-
transition: all var(--nuraly-transition-fast) ease;
|
|
128
|
-
position: relative;
|
|
129
|
-
overflow: hidden;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.toast:hover {
|
|
133
|
-
box-shadow: var(--nuraly-shadow-toast-hover);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* Toast type variants */
|
|
137
|
-
.toast--default {
|
|
138
|
-
background-color: var(--nuraly-toast-default-background);
|
|
139
|
-
border-color: var(--nuraly-toast-default-border);
|
|
140
|
-
color: var(--nuraly-toast-default-text);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.toast--success {
|
|
144
|
-
background-color: var(--nuraly-toast-success-background);
|
|
145
|
-
border-color: var(--nuraly-toast-success-border);
|
|
146
|
-
color: var(--nuraly-toast-success-text);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.toast--error {
|
|
150
|
-
background-color: var(--nuraly-toast-error-background);
|
|
151
|
-
border-color: var(--nuraly-toast-error-border);
|
|
152
|
-
color: var(--nuraly-toast-error-text);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.toast--warning {
|
|
156
|
-
background-color: var(--nuraly-toast-warning-background);
|
|
157
|
-
border-color: var(--nuraly-toast-warning-border);
|
|
158
|
-
color: var(--nuraly-toast-warning-text);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.toast--info {
|
|
162
|
-
background-color: var(--nuraly-toast-info-background);
|
|
163
|
-
border-color: var(--nuraly-toast-info-border);
|
|
164
|
-
color: var(--nuraly-toast-info-text);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/* Toast icon */
|
|
168
|
-
.toast__icon {
|
|
169
|
-
flex-shrink: 0;
|
|
170
|
-
display: flex;
|
|
171
|
-
align-items: center;
|
|
172
|
-
justify-content: center;
|
|
173
|
-
margin-top: 0.125rem; /* Slight adjustment for better visual alignment */
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.toast__icon nr-icon {
|
|
177
|
-
color: inherit;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/* Toast content */
|
|
181
|
-
.toast__content {
|
|
182
|
-
flex: 1;
|
|
183
|
-
display: flex;
|
|
184
|
-
flex-direction: column;
|
|
185
|
-
gap: var(--nuraly-spacing-2);
|
|
186
|
-
min-width: 0;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.toast__text {
|
|
190
|
-
font-size: var(--nuraly-font-size-sm);
|
|
191
|
-
line-height: 1.5;
|
|
192
|
-
word-break: break-word;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/* Toast button */
|
|
196
|
-
.toast__button {
|
|
197
|
-
display: flex;
|
|
198
|
-
align-items: center;
|
|
199
|
-
margin-top: var(--nuraly-spacing-1);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.toast__button nr-button {
|
|
203
|
-
flex-shrink: 0;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/* Close button */
|
|
207
|
-
.toast__close {
|
|
208
|
-
flex-shrink: 0;
|
|
209
|
-
min-width: var(--nuraly-toast-close-size);
|
|
210
|
-
min-height: var(--nuraly-toast-close-size);
|
|
211
|
-
padding: 0;
|
|
212
|
-
border: none;
|
|
213
|
-
background: transparent;
|
|
214
|
-
color: currentColor;
|
|
215
|
-
cursor: pointer;
|
|
216
|
-
display: flex;
|
|
217
|
-
align-items: center;
|
|
218
|
-
justify-content: center;
|
|
219
|
-
border-radius: var(--nuraly-border-radius-small);
|
|
220
|
-
transition: all var(--nuraly-transition-fast) ease;
|
|
221
|
-
opacity: var(--nuraly-toast-close-opacity);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.toast__close:hover {
|
|
225
|
-
opacity: var(--nuraly-toast-close-opacity-hover);
|
|
226
|
-
background-color: var(--nuraly-toast-close-hover-background);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.toast__close:focus {
|
|
230
|
-
outline: var(--nuraly-focus-outline);
|
|
231
|
-
outline-offset: var(--nuraly-focus-outline-offset);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.toast__close nr-icon {
|
|
235
|
-
color: inherit;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/* Animations */
|
|
239
|
-
@keyframes toast-fade-in {
|
|
240
|
-
from {
|
|
241
|
-
opacity: 0;
|
|
242
|
-
transform: translateY(-1rem);
|
|
243
|
-
}
|
|
244
|
-
to {
|
|
245
|
-
opacity: 1;
|
|
246
|
-
transform: translateY(0);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
@keyframes toast-fade-out {
|
|
251
|
-
from {
|
|
252
|
-
opacity: 1;
|
|
253
|
-
transform: translateY(0);
|
|
254
|
-
}
|
|
255
|
-
to {
|
|
256
|
-
opacity: 0;
|
|
257
|
-
transform: translateY(-1rem);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
@keyframes toast-slide-in-right {
|
|
262
|
-
from {
|
|
263
|
-
opacity: 0;
|
|
264
|
-
transform: translateX(100%);
|
|
265
|
-
}
|
|
266
|
-
to {
|
|
267
|
-
opacity: 1;
|
|
268
|
-
transform: translateX(0);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
@keyframes toast-slide-out-right {
|
|
273
|
-
from {
|
|
274
|
-
opacity: 1;
|
|
275
|
-
transform: translateX(0);
|
|
276
|
-
}
|
|
277
|
-
to {
|
|
278
|
-
opacity: 0;
|
|
279
|
-
transform: translateX(100%);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
@keyframes toast-slide-in-left {
|
|
284
|
-
from {
|
|
285
|
-
opacity: 0;
|
|
286
|
-
transform: translateX(-100%);
|
|
287
|
-
}
|
|
288
|
-
to {
|
|
289
|
-
opacity: 1;
|
|
290
|
-
transform: translateX(0);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
@keyframes toast-slide-out-left {
|
|
295
|
-
from {
|
|
296
|
-
opacity: 1;
|
|
297
|
-
transform: translateX(0);
|
|
298
|
-
}
|
|
299
|
-
to {
|
|
300
|
-
opacity: 0;
|
|
301
|
-
transform: translateX(-100%);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
@keyframes toast-bounce-in {
|
|
306
|
-
0% {
|
|
307
|
-
opacity: 0;
|
|
308
|
-
transform: scale(0.3);
|
|
309
|
-
}
|
|
310
|
-
50% {
|
|
311
|
-
transform: scale(1.05);
|
|
312
|
-
}
|
|
313
|
-
70% {
|
|
314
|
-
transform: scale(0.9);
|
|
315
|
-
}
|
|
316
|
-
100% {
|
|
317
|
-
opacity: 1;
|
|
318
|
-
transform: scale(1);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
@keyframes toast-bounce-out {
|
|
323
|
-
0% {
|
|
324
|
-
transform: scale(1);
|
|
325
|
-
}
|
|
326
|
-
25% {
|
|
327
|
-
transform: scale(0.95);
|
|
328
|
-
}
|
|
329
|
-
50% {
|
|
330
|
-
opacity: 1;
|
|
331
|
-
transform: scale(1.1);
|
|
332
|
-
}
|
|
333
|
-
100% {
|
|
334
|
-
opacity: 0;
|
|
335
|
-
transform: scale(0.3);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/* Animation classes */
|
|
340
|
-
.toast--fade-in {
|
|
341
|
-
animation: toast-fade-in var(--nuraly-transition-toast) ease;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.toast--fade-out {
|
|
345
|
-
animation: toast-fade-out var(--nuraly-transition-toast) ease;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.toast--slide-in {
|
|
349
|
-
animation: toast-slide-in-right var(--nuraly-transition-toast) ease;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.toast--slide-out {
|
|
353
|
-
animation: toast-slide-out-right var(--nuraly-transition-toast) ease;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.toast--bounce-in {
|
|
357
|
-
animation: toast-bounce-in var(--nuraly-transition-toast) ease;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.toast--bounce-out {
|
|
361
|
-
animation: toast-bounce-out var(--nuraly-transition-toast) ease;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/* Position-specific slide animations */
|
|
365
|
-
:host([position="top-left"]) .toast--slide-in,
|
|
366
|
-
:host([position="bottom-left"]) .toast--slide-in {
|
|
367
|
-
animation: toast-slide-in-left var(--nuraly-transition-toast) ease;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
:host([position="top-left"]) .toast--slide-out,
|
|
371
|
-
:host([position="bottom-left"]) .toast--slide-out {
|
|
372
|
-
animation: toast-slide-out-left var(--nuraly-transition-toast) ease;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
/* Progress bar for duration indicator */
|
|
376
|
-
.toast__progress {
|
|
377
|
-
position: absolute;
|
|
378
|
-
bottom: 0;
|
|
379
|
-
left: 0;
|
|
380
|
-
height: var(--nuraly-toast-progress-height);
|
|
381
|
-
background-color: currentColor;
|
|
382
|
-
opacity: var(--nuraly-toast-progress-opacity);
|
|
383
|
-
transition: width linear;
|
|
384
|
-
}
|
|
385
|
-
`
|
|
1
|
+
import{css as t,LitElement as o,html as a,nothing as r}from"lit";import{property as s,state as n,customElement as i}from"lit/decorators.js";import{repeat as e}from"lit/directives/repeat.js";import{classMap as l}from"lit/directives/class-map.js";import{NuralyUIBaseMixin as c}from"@nuralyui/common/mixins";
|
|
386
2
|
/**
|
|
387
3
|
* @license
|
|
388
4
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
389
5
|
* SPDX-License-Identifier: MIT
|
|
390
|
-
|
|
6
|
+
*/const u=t`:host{display:block;position:fixed;z-index:var(--nuraly-z-index-toast);pointer-events:none;color:var(--nuraly-color-text);font-family:var(--nuraly-font-family)}:host([position=top-right]){top:var(--nuraly-spacing-4);right:var(--nuraly-spacing-4)}:host([position=top-left]){top:var(--nuraly-spacing-4);left:var(--nuraly-spacing-4)}:host([position=top-center]){top:var(--nuraly-spacing-4);left:50%;transform:translateX(-50%)}:host([position=bottom-right]){bottom:var(--nuraly-spacing-4);right:var(--nuraly-spacing-4)}:host([position=bottom-left]){bottom:var(--nuraly-spacing-4);left:var(--nuraly-spacing-4)}:host([position=bottom-center]){bottom:var(--nuraly-spacing-4);left:50%;transform:translateX(-50%)}.toast-container{display:flex;flex-direction:column;gap:var(--nuraly-toast-stack-gap);min-width:var(--nuraly-toast-min-width);max-width:var(--nuraly-toast-max-width)}.toast{display:flex;align-items:start;gap:var(--nuraly-toast-gap);padding:var(--nuraly-toast-padding-vertical) var(--nuraly-toast-padding-horizontal);background-color:var(--nuraly-color-background);color:var(--nuraly-color-text);border:1px solid var(--nuraly-color-border);border-radius:var(--nuraly-border-radius-toast);box-shadow:var(--nuraly-shadow-toast);pointer-events:auto;cursor:default;transition:all var(--nuraly-transition-fast) ease;position:relative;overflow:hidden}.toast:hover{box-shadow:var(--nuraly-shadow-toast-hover)}.toast--default{background-color:var(--nuraly-toast-default-background);border-color:var(--nuraly-toast-default-border);color:var(--nuraly-toast-default-text)}.toast--success{background-color:var(--nuraly-toast-success-background);border-color:var(--nuraly-toast-success-border);color:var(--nuraly-toast-success-text)}.toast--error{background-color:var(--nuraly-toast-error-background);border-color:var(--nuraly-toast-error-border);color:var(--nuraly-toast-error-text)}.toast--warning{background-color:var(--nuraly-toast-warning-background);border-color:var(--nuraly-toast-warning-border);color:var(--nuraly-toast-warning-text)}.toast--info{background-color:var(--nuraly-toast-info-background);border-color:var(--nuraly-toast-info-border);color:var(--nuraly-toast-info-text)}.toast__icon{flex-shrink:0;display:flex;align-items:center;justify-content:center;margin-top:.125rem}.toast__icon nr-icon{color:inherit}.toast__content{flex:1;display:flex;flex-direction:column;gap:var(--nuraly-spacing-2);min-width:0}.toast__text{font-size:var(--nuraly-font-size-sm);line-height:1.5;word-break:break-word}.toast__button{display:flex;align-items:center;margin-top:var(--nuraly-spacing-1)}.toast__button nr-button{flex-shrink:0}.toast__close{flex-shrink:0;min-width:var(--nuraly-toast-close-size);min-height:var(--nuraly-toast-close-size);padding:0;border:none;background:0 0;color:currentColor;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:var(--nuraly-border-radius-small);transition:all var(--nuraly-transition-fast) ease;opacity:var(--nuraly-toast-close-opacity)}.toast__close:hover{opacity:var(--nuraly-toast-close-opacity-hover);background-color:var(--nuraly-toast-close-hover-background)}.toast__close:focus{outline:var(--nuraly-focus-outline);outline-offset:var(--nuraly-focus-outline-offset)}.toast__close nr-icon{color:inherit}@keyframes toast-fade-in{from{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}@keyframes toast-fade-out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-1rem)}}@keyframes toast-slide-in-right{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}@keyframes toast-slide-out-right{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}@keyframes toast-slide-in-left{from{opacity:0;transform:translateX(-100%)}to{opacity:1;transform:translateX(0)}}@keyframes toast-slide-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-100%)}}@keyframes toast-bounce-in{0%{opacity:0;transform:scale(.3)}50%{transform:scale(1.05)}70%{transform:scale(.9)}100%{opacity:1;transform:scale(1)}}@keyframes toast-bounce-out{0%{transform:scale(1)}25%{transform:scale(.95)}50%{opacity:1;transform:scale(1.1)}100%{opacity:0;transform:scale(.3)}}.toast--fade-in{animation:toast-fade-in var(--nuraly-transition-toast) ease}.toast--fade-out{animation:toast-fade-out var(--nuraly-transition-toast) ease}.toast--slide-in{animation:toast-slide-in-right var(--nuraly-transition-toast) ease}.toast--slide-out{animation:toast-slide-out-right var(--nuraly-transition-toast) ease}.toast--bounce-in{animation:toast-bounce-in var(--nuraly-transition-toast) ease}.toast--bounce-out{animation:toast-bounce-out var(--nuraly-transition-toast) ease}:host([position=bottom-left]) .toast--slide-in,:host([position=top-left]) .toast--slide-in{animation:toast-slide-in-left var(--nuraly-transition-toast) ease}:host([position=bottom-left]) .toast--slide-out,:host([position=top-left]) .toast--slide-out{animation:toast-slide-out-left var(--nuraly-transition-toast) ease}.toast__progress{position:absolute;bottom:0;left:0;height:var(--nuraly-toast-progress-height);background-color:currentColor;opacity:var(--nuraly-toast-progress-opacity);transition:width linear}`
|
|
391
7
|
/**
|
|
392
8
|
* @license
|
|
393
|
-
* Copyright
|
|
394
|
-
* SPDX-License-Identifier:
|
|
395
|
-
|
|
9
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
10
|
+
* SPDX-License-Identifier: MIT
|
|
11
|
+
*/,d="",h=5e3,y=5;
|
|
396
12
|
/**
|
|
397
13
|
* @license
|
|
398
14
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
399
15
|
* SPDX-License-Identifier: MIT
|
|
400
16
|
*/
|
|
401
|
-
var
|
|
402
|
-
<div class="toast-container">
|
|
403
|
-
${ns(this.toasts,(t=>t.id),(t=>this.renderToast(t)))}
|
|
404
|
-
</div>
|
|
405
|
-
`}renderToast(t){const s={toast:!0,[`toast--${t.type}`]:!0,[this.getAnimationClass(t)]:!0,[t.customClass||""]:!!t.customClass};return $t`
|
|
406
|
-
<div
|
|
407
|
-
class=${rs(s)}
|
|
408
|
-
@click=${()=>this.handleToastClick(t)}
|
|
409
|
-
role="alert"
|
|
410
|
-
aria-live="polite"
|
|
411
|
-
>
|
|
412
|
-
${t.icon?$t`
|
|
413
|
-
<div class="toast__icon">
|
|
414
|
-
<nr-icon name=${t.icon} size="medium"></nr-icon>
|
|
415
|
-
</div>
|
|
416
|
-
`:_t}
|
|
417
|
-
|
|
418
|
-
<div class="toast__content">
|
|
419
|
-
${t.content?t.content:$t`
|
|
420
|
-
<div class="toast__text">${t.text}</div>
|
|
421
|
-
${t.button?this.renderButton(t.button):_t}
|
|
422
|
-
`}
|
|
423
|
-
</div>
|
|
424
|
-
|
|
425
|
-
${t.closable?$t`
|
|
426
|
-
<button
|
|
427
|
-
class="toast__close"
|
|
428
|
-
@click=${s=>this.handleCloseClick(s,t)}
|
|
429
|
-
aria-label="Close notification"
|
|
430
|
-
type="button"
|
|
431
|
-
>
|
|
432
|
-
<nr-icon name="x" size="small"></nr-icon>
|
|
433
|
-
</button>
|
|
434
|
-
`:_t}
|
|
435
|
-
</div>
|
|
436
|
-
`}renderButton(t){return $t`
|
|
437
|
-
<div class="toast__button">
|
|
438
|
-
<nr-button
|
|
439
|
-
type=${t.type||"default"}
|
|
440
|
-
size=${t.size||"small"}
|
|
441
|
-
?disabled=${t.disabled||!1}
|
|
442
|
-
@click=${s=>{s.stopPropagation(),t.onClick(s)}}
|
|
443
|
-
>
|
|
444
|
-
${t.icon?$t`<nr-icon slot="icon-left" name=${t.icon}></nr-icon>`:_t}
|
|
445
|
-
${t.label}
|
|
446
|
-
</nr-button>
|
|
447
|
-
</div>
|
|
448
|
-
`}};ys.styles=as,ps([Vt({type:String,reflect:!0})],ys.prototype,"position",void 0),ps([Vt({type:Number})],ys.prototype,"maxToasts",void 0),ps([Vt({type:Number})],ys.prototype,"defaultDuration",void 0),ps([Vt({type:String})],ys.prototype,"animation",void 0),ps([Vt({type:Boolean})],ys.prototype,"stack",void 0),ps([Vt({type:Boolean})],ys.prototype,"autoDismiss",void 0),ps([function(t){return Vt({...t,state:!0})}()],ys.prototype,"toasts",void 0),ys=ps([(t=>s=>"function"==typeof s?((t,s)=>(customElements.define(t,s),s))(t,s):((t,s)=>{const{kind:i,elements:o}=s;return{kind:i,elements:o,finisher(s){customElements.define(t,s)}}})(t,s))("nr-toast")],ys);
|
|
17
|
+
var f=function(t,o,a,r){for(var s,n=arguments.length,i=n<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,a):r,e=t.length-1;e>=0;e--)(s=t[e])&&(i=(n<3?s(i):n>3?s(o,a,i):s(o,a))||i);return n>3&&i&&Object.defineProperty(o,a,i),i};let p=class extends(c(o)){constructor(){super(...arguments),this.requiredComponents=["nr-icon","nr-button"],this.position="top-right",this.maxToasts=5,this.defaultDuration=5e3,this.animation="fade",this.stack=!0,this.autoDismiss=!0,this.toasts=[],this.timeouts=new Map}show(t){var o,a,r;const s="string"==typeof t?{text:t}:t,n={id:this.generateId(),timestamp:Date.now(),text:s.text,content:s.content,type:s.type||"default",duration:null!==(o=s.duration)&&void 0!==o?o:this.defaultDuration,autoDismiss:null!==(a=s.autoDismiss)&&void 0!==a?a:this.autoDismiss,closable:null===(r=s.closable)||void 0===r||r,icon:s.icon||this.getDefaultIcon(s.type),customClass:s.customClass,button:s.button,onClose:s.onClose,onClick:s.onClick};if(this.stack?this.toasts.length>=this.maxToasts&&this.removeToast(this.toasts[0].id):this.clearAll(),this.toasts=[...this.toasts,n],this.emitToastEvent("nr-toast-show",n,"show"),n.autoDismiss&&n.duration&&n.duration>0){const t=window.setTimeout((()=>{this.removeToast(n.id)}),n.duration);this.timeouts.set(n.id,t)}return n.id}success(t,o){return this.show({text:t,type:"success",duration:o})}error(t,o){return this.show({text:t,type:"error",duration:o})}warning(t,o){return this.show({text:t,type:"warning",duration:o})}info(t,o){return this.show({text:t,type:"info",duration:o})}removeToast(t){const o=this.toasts.find((o=>o.id===t));if(!o)return;o.removing=!0,this.requestUpdate();const a=this.timeouts.get(t);a&&(clearTimeout(a),this.timeouts.delete(t)),setTimeout((()=>{var a;this.toasts=this.toasts.filter((o=>o.id!==t)),this.emitToastEvent("nr-toast-close",o,"close"),null===(a=o.onClose)||void 0===a||a.call(o)}),300)}clearAll(){this.toasts.forEach((t=>{const o=this.timeouts.get(t.id);o&&clearTimeout(o)})),this.timeouts.clear(),this.toasts=[]}handleToastClick(t){var o;this.emitToastEvent("nr-toast-click",t,"click"),null===(o=t.onClick)||void 0===o||o.call(t)}handleCloseClick(t,o){t.stopPropagation(),this.removeToast(o.id)}getDefaultIcon(t){switch(t){case"success":return"check-circle";case"error":return"x-circle";case"warning":return"alert-triangle";case"info":return"info";default:return""}}generateId(){return`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}getAnimationClass(t){const o=t.removing?"out":"in";return`toast--${this.animation}-${o}`}emitToastEvent(t,o,a){this.dispatchEvent(new CustomEvent(t,{detail:{toast:o,action:a},bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.clearAll()}render(){return a`<div class="toast-container">${e(this.toasts,(t=>t.id),(t=>this.renderToast(t)))}</div>`}renderToast(t){const o={toast:!0,[`toast--${t.type}`]:!0,[this.getAnimationClass(t)]:!0,[t.customClass||""]:!!t.customClass};return a`<div class="${l(o)}" @click="${()=>this.handleToastClick(t)}" role="alert" aria-live="polite">${t.icon?a`<div class="toast__icon"><nr-icon name="${t.icon}" size="medium"></nr-icon></div>`:r}<div class="toast__content">${t.content?t.content:a`<div class="toast__text">${t.text}</div>${t.button?this.renderButton(t.button):r}`}</div>${t.closable?a`<button class="toast__close" @click="${o=>this.handleCloseClick(o,t)}" aria-label="Close notification" type="button"><nr-icon name="x" size="small"></nr-icon></button>`:r}</div>`}renderButton(t){return a`<div class="toast__button"><nr-button type="${t.type||"default"}" size="${t.size||"small"}" ?disabled="${t.disabled||!1}" @click="${o=>{o.stopPropagation(),t.onClick(o)}}">${t.icon?a`<nr-icon slot="icon-left" name="${t.icon}"></nr-icon>`:r} ${t.label}</nr-button></div>`}};p.styles=u,f([s({type:String,reflect:!0})],p.prototype,"position",void 0),f([s({type:Number})],p.prototype,"maxToasts",void 0),f([s({type:Number})],p.prototype,"defaultDuration",void 0),f([s({type:String})],p.prototype,"animation",void 0),f([s({type:Boolean})],p.prototype,"stack",void 0),f([s({type:Boolean})],p.prototype,"autoDismiss",void 0),f([n()],p.prototype,"toasts",void 0),p=f([i("nr-toast")],p);
|
|
449
18
|
/**
|
|
450
19
|
* @license
|
|
451
20
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
452
21
|
* SPDX-License-Identifier: MIT
|
|
453
22
|
*/
|
|
454
|
-
class
|
|
23
|
+
class m{constructor(t){this._host=t,this._host.addController(this)}get host(){return this._host}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}handleError(t,o){console.error(`[ToastController:${this.constructor.name}] Error in ${o}:`,t),this._host.dispatchEvent(new CustomEvent("nr-toast-error",{detail:{error:t.message,context:o,controller:this.constructor.name},bubbles:!0,composed:!0}))}requestUpdate(){try{this._host.requestUpdate()}catch(t){this.handleError(t,"requestUpdate")}}dispatchEvent(t){try{return this._host.dispatchEvent(t)}catch(t){return this.handleError(t,"dispatchEvent"),!1}}}export{m as BaseToastController,y as DEFAULT_MAX_TOASTS,h as DEFAULT_TOAST_DURATION,d as EMPTY_STRING,p as NrToastElement};
|