@cas-smartdesign/snackbar 3.0.2 → 3.1.0
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/docs/doc.css +1 -1
- package/dist/docs/doc.mjs +44 -47
- package/dist/snackbar-with-externals.js +15 -45
- package/dist/snackbar-with-externals.js.map +4 -4
- package/dist/snackbar.mjs +27 -29
- package/dist/snackbar.mjs.map +1 -1
- package/npm-third-party-licenses.json +52 -47
- package/package.json +4 -4
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var window;(window||={})["@cas-smartdesign/snackbar"]=(()=>{var
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Et=/'/g,Ct=/"/g,Tt=/^(?:script|style|textarea|title)$/i,Ut=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),U=Ut(1),me=Ut(2),g=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),xt=new WeakMap,E=C.createTreeWalker(C,129,null,!1);function Ht(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return yt!==void 0?yt.createHTML(t):t}var Ot=(s,t)=>{let e=s.length-1,i=[],r,n=t===2?"<svg>":"",o=N;for(let h=0;h<e;h++){let a=s[h],l,c,p=-1,d=0;for(;d<a.length&&(o.lastIndex=d,c=o.exec(a),c!==null);)d=o.lastIndex,o===N?c[1]==="!--"?o=St:c[1]!==void 0?o=bt:c[2]!==void 0?(Tt.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=b):c[3]!==void 0&&(o=b):o===b?c[0]===">"?(o=r??N,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,l=c[1],o=c[3]===void 0?b:c[3]==='"'?Ct:Et):o===Ct||o===Et?o=b:o===St||o===bt?o=N:(o=b,r=void 0);let u=o===b&&s[h+1].startsWith("/>")?" ":"";n+=o===N?a+Xt:p>=0?(i.push(l),a.slice(0,p)+Q+a.slice(p)+A+u):a+A+(p===-2?(i.push(void 0),h):u)}return[Ht(s,n+(s[e]||"<?>")+(t===2?"</svg>":"")),i]},L=class s{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0,h=t.length-1,a=this.parts,[l,c]=Ot(t,e);if(this.el=s.createElement(l,i),E.currentNode=this.el.content,e===2){let p=this.el.content,d=p.firstChild;d.remove(),p.append(...d.childNodes)}for(;(r=E.nextNode())!==null&&a.length<h;){if(r.nodeType===1){if(r.hasAttributes()){let p=[];for(let d of r.getAttributeNames())if(d.endsWith(Q)||d.startsWith(A)){let u=c[o++];if(p.push(d),u!==void 0){let v=r.getAttribute(u.toLowerCase()+Q).split(A),m=/([.?@])?(.*)/.exec(u);a.push({type:1,index:n,name:m[2],strings:v,ctor:m[1]==="."?K:m[1]==="?"?J:m[1]==="@"?G:k})}else a.push({type:6,index:n})}for(let d of p)r.removeAttribute(d)}if(Tt.test(r.tagName)){let p=r.textContent.split(A),d=p.length-1;if(d>0){r.textContent=P?P.emptyScript:"";for(let u=0;u<d;u++)r.append(p[u],D()),E.nextNode(),a.push({type:2,index:++n});r.append(p[d],D())}}}else if(r.nodeType===8)if(r.data===ct)a.push({type:2,index:n});else{let p=-1;for(;(p=r.data.indexOf(A,p+1))!==-1;)a.push({type:7,index:n}),p+=A.length-1}n++}}static createElement(t,e){let i=C.createElement("template");return i.innerHTML=t,i}};function x(s,t,e=s,i){var r,n,o,h;if(t===g)return t;let a=i!==void 0?(r=e._$Co)===null||r===void 0?void 0:r[i]:e._$Cl,l=I(t)?void 0:t._$litDirective$;return a?.constructor!==l&&((n=a?._$AO)===null||n===void 0||n.call(a,!1),l===void 0?a=void 0:(a=new l(s),a._$AT(s,e,i)),i!==void 0?((o=(h=e)._$Co)!==null&&o!==void 0?o:h._$Co=[])[i]=a:e._$Cl=a),a!==void 0&&(t=x(s,a._$AS(s,t.values),a,i)),t}var W=class{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){var e;let{el:{content:i},parts:r}=this._$AD,n=((e=t?.creationScope)!==null&&e!==void 0?e:C).importNode(i,!0);E.currentNode=n;let o=E.nextNode(),h=0,a=0,l=r[0];for(;l!==void 0;){if(h===l.index){let c;l.type===2?c=new T(o,o.nextSibling,this,t):l.type===1?c=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(c=new Y(o,this,t)),this._$AV.push(c),l=r[++a]}h!==l?.index&&(o=E.nextNode(),h++)}return E.currentNode=C,n}v(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},T=class s{constructor(t,e,i,r){var n;this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cp=(n=r?.isConnected)===null||n===void 0||n}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=x(this,t,e),I(t)?t===$||t==null||t===""?(this._$AH!==$&&this._$AR(),this._$AH=$):t!==this._$AH&&t!==g&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Pt(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(this._$AH)?this._$AA.nextSibling.data=t:this.$(C.createTextNode(t)),this._$AH=t}g(t){var e;let{values:i,_$litType$:r}=t,n=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=L.createElement(Ht(r.h,r.h[0]),this.options)),r);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===n)this._$AH.v(i);else{let o=new W(n,this),h=o.u(this.options);o.v(i),this.$(h),this._$AH=o}}_$AC(t){let e=xt.get(t.strings);return e===void 0&&xt.set(t.strings,e=new L(t)),e}T(t){wt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,r=0;for(let n of t)r===e.length?e.push(i=new s(this.k(D()),this.k(D()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){let r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}},k=class{constructor(t,e,i,r,n){this.type=1,this._$AH=$,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,r){let n=this.strings,o=!1;if(n===void 0)t=x(this,t,e,0),o=!I(t)||t!==this._$AH&&t!==g,o&&(this._$AH=t);else{let h=t,a,l;for(t=n[0],a=0;a<n.length-1;a++)l=x(this,h[i+a],e,a),l===g&&(l=this._$AH[a]),o||(o=!I(l)||l!==this._$AH[a]),l===$?t=$:t!==$&&(t+=(l??"")+n[a+1]),this._$AH[a]=l}o&&!r&&this.j(t)}j(t){t===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},K=class extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$?void 0:t}},te=P?P.emptyScript:"",J=class extends k{constructor(){super(...arguments),this.type=4}j(t){t&&t!==$?this.element.setAttribute(this.name,te):this.element.removeAttribute(this.name)}},G=class extends k{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){var i;if((t=(i=x(this,t,e,0))!==null&&i!==void 0?i:$)===g)return;let r=this._$AH,n=t===$&&r!==$||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==$&&(r===$||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&i!==void 0?i:this.element,t):this._$AH.handleEvent(t)}},Y=class{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){x(this,t)}},Rt={O:Q,P:A,A:ct,C:1,M:Ot,L:W,R:Pt,D:x,I:T,V:k,H:J,N:G,U:K,F:Y},kt=F.litHtmlPolyfillSupport;kt?.(L,T),((ht=F.litHtmlVersions)!==null&&ht!==void 0?ht:F.litHtmlVersions=[]).push("2.8.0");var Z=(s,t,e)=>{var i,r;let n=(i=e?.renderBefore)!==null&&i!==void 0?i:t,o=n._$litPart$;if(o===void 0){let h=(r=e?.renderBefore)!==null&&r!==void 0?r:null;n._$litPart$=o=new T(t.insertBefore(D(),h),h,void 0,e??{})}return o._$AI(s),o};var ut,pt;var y=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;let i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Z(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return g}};y.finalized=!0,y._$litElement$=!0,(ut=globalThis.litElementHydrateSupport)===null||ut===void 0||ut.call(globalThis,{LitElement:y});var Mt=globalThis.litElementPolyfillSupport;Mt?.({LitElement:y});((pt=globalThis.litElementVersions)!==null&&pt!==void 0?pt:globalThis.litElementVersions=[]).push("3.3.3");var ee=(s,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,s)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,s)}},se=(s,t,e)=>{t.constructor.createProperty(e,s)};function vt(s){return(t,e)=>e!==void 0?se(s,t,e):ee(s,t)}var Nt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dt=s=>(...t)=>({_$litDirective$:s,values:t}),X=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var{I:ie}=Rt;var It=()=>document.createComment(""),H=(s,t,e)=>{var i;let r=s._$AA.parentNode,n=t===void 0?s._$AB:t._$AA;if(e===void 0){let o=r.insertBefore(It(),n),h=r.insertBefore(It(),n);e=new ie(o,h,s,s.options)}else{let o=e._$AB.nextSibling,h=e._$AM,a=h!==s;if(a){let l;(i=e._$AQ)===null||i===void 0||i.call(e,s),e._$AM=s,e._$AP!==void 0&&(l=s._$AU)!==h._$AU&&e._$AP(l)}if(o!==n||a){let l=e._$AA;for(;l!==o;){let c=l.nextSibling;r.insertBefore(l,n),l=c}}}return e},S=(s,t,e=s)=>(s._$AI(t,e),s),re={},Lt=(s,t=re)=>s._$AH=t,qt=s=>s._$AH,tt=s=>{var t;(t=s._$AP)===null||t===void 0||t.call(s,!1,!0);let e=s._$AA,i=s._$AB.nextSibling;for(;e!==i;){let r=e.nextSibling;e.remove(),e=r}};var zt=(s,t,e)=>{let i=new Map;for(let r=t;r<=e;r++)i.set(s[r],r);return i},Bt=Dt(class extends X{constructor(s){if(super(s),s.type!==Nt.CHILD)throw Error("repeat() can only be used in text expressions")}ct(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let r=[],n=[],o=0;for(let h of s)r[o]=i?i(h,o):o,n[o]=e(h,o),o++;return{values:n,keys:r}}render(s,t,e){return this.ct(s,t,e).values}update(s,[t,e,i]){var r;let n=qt(s),{values:o,keys:h}=this.ct(t,e,i);if(!Array.isArray(n))return this.ut=h,o;let a=(r=this.ut)!==null&&r!==void 0?r:this.ut=[],l=[],c,p,d=0,u=n.length-1,v=0,m=o.length-1;for(;d<=u&&v<=m;)if(n[d]===null)d++;else if(n[u]===null)u--;else if(a[d]===h[v])l[v]=S(n[d],o[v]),d++,v++;else if(a[u]===h[m])l[m]=S(n[u],o[m]),u--,m--;else if(a[d]===h[m])l[m]=S(n[d],o[m]),H(s,l[m+1],n[d]),d++,m--;else if(a[u]===h[v])l[v]=S(n[u],o[v]),H(s,n[d],n[u]),u--,v++;else if(c===void 0&&(c=zt(h,v,m),p=zt(a,d,u)),c.has(a[d]))if(c.has(a[u])){let f=p.get(h[v]),et=f!==void 0?n[f]:null;if(et===null){let mt=H(s,n[d]);S(mt,o[v]),l[v]=mt}else l[v]=S(et,o[v]),H(s,n[d],et),n[f]=null;v++}else tt(n[u]),u--;else tt(n[d]),d++;for(;v<=m;){let f=H(s,l[m+1]);S(f,o[v]),l[v++]=f}for(;d<=u;){let f=n[d++];f!==null&&tt(f)}return this.ut=h,Lt(s,l),g}});var jt=s=>s??$;var ne=":host{display:block;contain:layout;margin-top:6px;margin-bottom:6px;position:relative;transition:height var(--sd-snackbar-height-transition-duration, .4s)}.root{display:flex;width:100%;height:100%}",oe=":host{position:fixed;display:flex;flex-direction:column;box-sizing:border-box;max-height:100%;contain:layout}:host([vertical-position=bottom]){flex-direction:column-reverse;bottom:var(--sd-snackbar-vertical-offset, 14px)}:host([vertical-position=top]){top:var(--sd-snackbar-vertical-offset, 14px)}:host([horizontal-position=left]){left:var(--sd-snackbar-horizontal-offset, 20px)}:host([horizontal-position=center]){left:50%;transform:translate(-50%)}:host([horizontal-position=right]){right:var(--sd-snackbar-horizontal-offset, 20px)}",ae=Object.defineProperty,le=Object.getOwnPropertyDescriptor,Vt=(s,t,e,i)=>{for(var r=i>1?void 0:i?le(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ae(t,e,r),r},w,$t=(w=class extends y{constructor(){super(...arguments),this.verticalPosition="bottom",this.horizontalPosition="left",this.maxStack=3,this.shouldCloseOldest=!1,this._queue=[],this._rendered=[]}static get styles(){return[B`
|
|
4
|
-
${
|
|
5
|
-
`]}render(){return this.renderSnackbars(),
|
|
6
|
-
${
|
|
7
|
-
`,this)}open(s){this._queue.push({snackbar:s,direction:"in"}),this.updateQueue()}close(s){s?this.requestSnackbarClose(s):this._rendered.forEach(({id:t})=>this.requestSnackbarClose(t))}renderSnackbar({message:s,options:t={}}){
|
|
1
|
+
var window;(window||={})["@cas-smartdesign/snackbar"]=(()=>{var et=Object.defineProperty;var qt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var jt=Object.prototype.hasOwnProperty;var zt=(s,t)=>{for(var e in t)et(s,e,{get:t[e],enumerable:!0})},Bt=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of It(t))!jt.call(s,i)&&i!==e&&et(s,i,{get:()=>t[i],enumerable:!(r=qt(t,i))||r.enumerable});return s};var Vt=s=>Bt(et({},"__esModule",{value:!0}),s);var ce={};zt(ce,{Snackbar:()=>Lt,SnackbarProvider:()=>le});var I=globalThis,j=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,st=Symbol(),mt=new WeakMap,M=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==st)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(j&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=mt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&mt.set(e,t))}return t}toString(){return this.cssText}},O=s=>new M(typeof s=="string"?s:s+"",void 0,st),z=(s,...t)=>{let e=s.length===1?s[0]:t.reduce(((r,i,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[o+1]),s[0]);return new M(e,s,st)},ft=(s,t)=>{if(j)s.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let r=document.createElement("style"),i=I.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=e.cssText,s.appendChild(r)}},it=j?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return O(e)})(s):s;var{is:Ft,defineProperty:Qt,getOwnPropertyDescriptor:Wt,getOwnPropertyNames:Kt,getOwnPropertySymbols:Zt,getPrototypeOf:Jt}=Object,B=globalThis,$t=B.trustedTypes,Gt=$t?$t.emptyScript:"",Yt=B.reactiveElementPolyfillSupport,H=(s,t)=>s,R={toAttribute(s,t){switch(t){case Boolean:s=s?Gt:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},V=(s,t)=>!Ft(s,t),_t={attribute:!0,type:String,converter:R,reflect:!1,useDefault:!1,hasChanged:V};Symbol.metadata??=Symbol("metadata"),B.litPropertyMetadata??=new WeakMap;var _=class 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=_t){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){let r=Symbol(),i=this.getPropertyDescriptor(t,r,e);i!==void 0&&Qt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,r){let{get:i,set:o}=Wt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:i,set(n){let l=i?.call(this);o?.call(this,n),this.requestUpdate(t,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_t}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;let t=Jt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(H("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(H("properties"))){let e=this.properties,r=[...Kt(e),...Zt(e)];for(let i of r)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,i]of e)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let i=this._$Eu(e,r);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let i of r)e.unshift(it(i))}else t!==void 0&&e.push(it(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?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),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ft(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,r){this._$AK(t,r)}_$ET(t,e){let r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(i!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:R).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let r=this.constructor,i=r._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=r.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:R;this._$Em=i;let l=n.fromAttribute(e,o.type);this[i]=l??this._$Ej?.get(i)??l,this._$Em=null}}requestUpdate(t,e,r){if(t!==void 0){let i=this.constructor,o=this[t];if(r??=i.getPropertyOptions(t),!((r.hasChanged??V)(o,e)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,r))))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:i,wrapped:o},n){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[i,o]of r){let{wrapped:n}=o,l=this[i];n!==!0||this._$AL.has(i)||l===void 0||this.C(i,void 0,o,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.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((e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[H("elementProperties")]=new Map,_[H("finalized")]=new Map,Yt?.({ReactiveElement:_}),(B.reactiveElementVersions??=[]).push("2.1.1");var ot=globalThis,F=ot.trustedTypes,vt=F?F.createPolicy("lit-html",{createHTML:s=>s}):void 0,nt="$lit$",v=`lit$${Math.random().toFixed(9).slice(2)}$`,at="?"+v,Xt=`<${at}>`,E=document,N=()=>E.createComment(""),L=s=>s===null||typeof s!="object"&&typeof s!="function",ht=Array.isArray,Et=s=>ht(s)||typeof s?.[Symbol.iterator]=="function",rt=`[
|
|
2
|
+
\f\r]`,D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,At=/-->/g,gt=/>/g,b=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),yt=/'/g,bt=/"/g,Ct=/^(?:script|style|textarea|title)$/i,lt=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),k=lt(1),$e=lt(2),_e=lt(3),A=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),St=new WeakMap,S=E.createTreeWalker(E,129);function xt(s,t){if(!ht(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return vt!==void 0?vt.createHTML(t):t}var wt=(s,t)=>{let e=s.length-1,r=[],i,o=t===2?"<svg>":t===3?"<math>":"",n=D;for(let l=0;l<e;l++){let a=s[l],d,m,h=-1,p=0;for(;p<a.length&&(n.lastIndex=p,m=n.exec(a),m!==null);)p=n.lastIndex,n===D?m[1]==="!--"?n=At:m[1]!==void 0?n=gt:m[2]!==void 0?(Ct.test(m[2])&&(i=RegExp("</"+m[2],"g")),n=b):m[3]!==void 0&&(n=b):n===b?m[0]===">"?(n=i??D,h=-1):m[1]===void 0?h=-2:(h=n.lastIndex-m[2].length,d=m[1],n=m[3]===void 0?b:m[3]==='"'?bt:yt):n===bt||n===yt?n=b:n===At||n===gt?n=D:(n=b,i=void 0);let c=n===b&&s[l+1].startsWith("/>")?" ":"";o+=n===D?a+Xt:h>=0?(r.push(d),a.slice(0,h)+nt+a.slice(h)+v+c):a+v+(h===-2?l:c)}return[xt(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},q=class s{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let o=0,n=0,l=t.length-1,a=this.parts,[d,m]=wt(t,e);if(this.el=s.createElement(d,r),S.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=S.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(nt)){let p=m[n++],c=i.getAttribute(h).split(v),f=/([.?@])?(.*)/.exec(p);a.push({type:1,index:o,name:f[2],strings:c,ctor:f[1]==="."?W:f[1]==="?"?K:f[1]==="@"?Z:x}),i.removeAttribute(h)}else h.startsWith(v)&&(a.push({type:6,index:o}),i.removeAttribute(h));if(Ct.test(i.tagName)){let h=i.textContent.split(v),p=h.length-1;if(p>0){i.textContent=F?F.emptyScript:"";for(let c=0;c<p;c++)i.append(h[c],N()),S.nextNode(),a.push({type:2,index:++o});i.append(h[p],N())}}}else if(i.nodeType===8)if(i.data===at)a.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(v,h+1))!==-1;)a.push({type:7,index:o}),h+=v.length-1}o++}}static createElement(t,e){let r=E.createElement("template");return r.innerHTML=t,r}};function C(s,t,e=s,r){if(t===A)return t;let i=r!==void 0?e._$Co?.[r]:e._$Cl,o=L(t)?void 0:t._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(s),i._$AT(s,e,r)),r!==void 0?(e._$Co??=[])[r]=i:e._$Cl=i),i!==void 0&&(t=C(s,i._$AS(s,t.values),i,r)),t}var Q=class{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){let{el:{content:e},parts:r}=this._$AD,i=(t?.creationScope??E).importNode(e,!0);S.currentNode=i;let o=S.nextNode(),n=0,l=0,a=r[0];for(;a!==void 0;){if(n===a.index){let d;a.type===2?d=new P(o,o.nextSibling,this,t):a.type===1?d=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(d=new J(o,this,t)),this._$AV.push(d),a=r[++l]}n!==a?.index&&(o=S.nextNode(),n++)}return S.currentNode=E,i}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},P=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,i){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=C(this,t,e),L(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Et(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!==u&&L(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=q.createElement(xt(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===i)this._$AH.p(e);else{let o=new Q(i,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=St.get(t.strings);return e===void 0&&St.set(t.strings,e=new q(t)),e}k(t){ht(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,i=0;for(let o of t)i===e.length?e.push(r=new s(this.O(N()),this.O(N()),this,this.options)):r=e[i],r._$AI(o),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let r=t.nextSibling;t.remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},x=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,o){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=u}_$AI(t,e=this,r,i){let o=this.strings,n=!1;if(o===void 0)t=C(this,t,e,0),n=!L(t)||t!==this._$AH&&t!==A,n&&(this._$AH=t);else{let l=t,a,d;for(t=o[0],a=0;a<o.length-1;a++)d=C(this,l[r+a],e,a),d===A&&(d=this._$AH[a]),n||=!L(d)||d!==this._$AH[a],d===u?t=u:t!==u&&(t+=(d??"")+o[a+1]),this._$AH[a]=d}n&&!i&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},W=class extends x{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}},K=class extends x{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}},Z=class extends x{constructor(t,e,r,i,o){super(t,e,r,i,o),this.type=5}_$AI(t,e=this){if((t=C(this,t,e,0)??u)===A)return;let r=this._$AH,i=t===u&&r!==u||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==u&&(r===u||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},J=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){C(this,t)}},Pt={M:nt,P:v,A:at,C:1,L:wt,R:Q,D:Et,V:C,I:P,H:x,N:K,U:Z,B:W,F:J},te=ot.litHtmlPolyfillSupport;te?.(q,P),(ot.litHtmlVersions??=[]).push("3.3.1");var G=(s,t,e)=>{let r=e?.renderBefore??t,i=r._$litPart$;if(i===void 0){let o=e?.renderBefore??null;r._$litPart$=i=new P(t.insertBefore(N(),o),o,void 0,e??{})}return i._$AI(s),i};var ct=globalThis,g=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=G(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return A}};g._$litElement$=!0,g.finalized=!0,ct.litElementHydrateSupport?.({LitElement:g});var ee=ct.litElementPolyfillSupport;ee?.({LitElement:g});(ct.litElementVersions??=[]).push("4.2.1");var se={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:V},ie=(s=se,t,e)=>{let{kind:r,metadata:i}=e,o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),r==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(e.name,s),r==="accessor"){let{name:n}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(n,a,s)},init(l){return l!==void 0&&this.C(n,void 0,s,l),l}}}if(r==="setter"){let{name:n}=e;return function(l){let a=this[n];t.call(this,l),this.requestUpdate(n,a,s)}}throw Error("Unsupported decorator location: "+r)};function dt(s){return(t,e)=>typeof e=="object"?ie(s,t,e):((r,i,o)=>{let n=i.hasOwnProperty(o);return i.constructor.createProperty(o,r),n?Object.getOwnPropertyDescriptor(i,o):void 0})(s,t,e)}var kt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Tt=s=>(...t)=>({_$litDirective$:s,values:t}),Y=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var{I:re}=Pt;var Ut=()=>document.createComment(""),T=(s,t,e)=>{let r=s._$AA.parentNode,i=t===void 0?s._$AB:t._$AA;if(e===void 0){let o=r.insertBefore(Ut(),i),n=r.insertBefore(Ut(),i);e=new re(o,n,s,s.options)}else{let o=e._$AB.nextSibling,n=e._$AM,l=n!==s;if(l){let a;e._$AQ?.(s),e._$AM=s,e._$AP!==void 0&&(a=s._$AU)!==n._$AU&&e._$AP(a)}if(o!==i||l){let a=e._$AA;for(;a!==o;){let d=a.nextSibling;r.insertBefore(a,i),a=d}}}return e},y=(s,t,e=s)=>(s._$AI(t,e),s),oe={},Mt=(s,t=oe)=>s._$AH=t,Ot=s=>s._$AH,X=s=>{s._$AR(),s._$AA.remove()};var Ht=(s,t,e)=>{let r=new Map;for(let i=t;i<=e;i++)r.set(s[i],i);return r},Rt=Tt(class extends Y{constructor(s){if(super(s),s.type!==kt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);let i=[],o=[],n=0;for(let l of s)i[n]=r?r(l,n):n,o[n]=e(l,n),n++;return{values:o,keys:i}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,r]){let i=Ot(s),{values:o,keys:n}=this.dt(t,e,r);if(!Array.isArray(i))return this.ut=n,o;let l=this.ut??=[],a=[],d,m,h=0,p=i.length-1,c=0,f=o.length-1;for(;h<=p&&c<=f;)if(i[h]===null)h++;else if(i[p]===null)p--;else if(l[h]===n[c])a[c]=y(i[h],o[c]),h++,c++;else if(l[p]===n[f])a[f]=y(i[p],o[f]),p--,f--;else if(l[h]===n[f])a[f]=y(i[h],o[f]),T(s,a[f+1],i[h]),h++,f--;else if(l[p]===n[c])a[c]=y(i[p],o[c]),T(s,i[h],i[p]),p--,c++;else if(d===void 0&&(d=Ht(n,c,f),m=Ht(l,h,p)),d.has(l[h]))if(d.has(l[p])){let $=m.get(n[c]),tt=$!==void 0?i[$]:null;if(tt===null){let ut=T(s,i[h]);y(ut,o[c]),a[c]=ut}else a[c]=y(tt,o[c]),T(s,i[h],tt),i[$]=null;c++}else X(i[p]),p--;else X(i[h]),h++;for(;c<=f;){let $=T(s,a[f+1]);y($,o[c]),a[c++]=$}for(;h<=p;){let $=i[h++];$!==null&&X($)}return this.ut=n,Mt(s,a),A}});var Dt=s=>s??u;var ne=":host{display:block;contain:layout;margin-top:6px;margin-bottom:6px;position:relative;transition:height var(--sd-snackbar-height-transition-duration, .4s)}.root{display:flex;width:100%;height:100%}",ae=":host{position:fixed;display:flex;flex-direction:column;box-sizing:border-box;max-height:100%;contain:layout}:host([vertical-position=bottom]){flex-direction:column-reverse;bottom:var(--sd-snackbar-vertical-offset, 14px)}:host([vertical-position=top]){top:var(--sd-snackbar-vertical-offset, 14px)}:host([horizontal-position=left]){left:var(--sd-snackbar-horizontal-offset, 20px)}:host([horizontal-position=center]){left:50%;transform:translate(-50%)}:host([horizontal-position=right]){right:var(--sd-snackbar-horizontal-offset, 20px)}",he=Object.defineProperty,Nt=(s,t,e,r)=>{for(var i=void 0,o=s.length-1,n;o>=0;o--)(n=s[o])&&(i=n(t,e,i)||i);return i&&he(t,e,i),i},w,pt=(w=class extends g{constructor(){super(...arguments),this.verticalPosition="bottom",this.horizontalPosition="left",this.maxStack=3,this.shouldCloseOldest=!1,this._queue=[],this._rendered=[]}static get styles(){return[z`
|
|
4
|
+
${O(ae)}
|
|
5
|
+
`]}render(){return this.renderSnackbars(),k` <slot></slot> `}renderSnackbars(){G(k`
|
|
6
|
+
${Rt(this._rendered,({id:s})=>s,s=>this.renderSnackbar(s))}
|
|
7
|
+
`,this)}open(s){this._queue.push({snackbar:s,direction:"in"}),this.updateQueue()}close(s){s?this.requestSnackbarClose(s):this._rendered.forEach(({id:t})=>this.requestSnackbarClose(t))}renderSnackbar({message:s,options:t={}}){return k`
|
|
8
8
|
<sd-snackbar
|
|
9
|
-
class="${
|
|
9
|
+
class="${Dt(t.classNames?.length>0?t.classNames.join(" "):void 0)}"
|
|
10
10
|
.animationIn="${this.animationIn}"
|
|
11
11
|
.animationOut="${this.animationOut}"
|
|
12
12
|
>
|
|
13
13
|
${this.renderSnackbarContent(s,t?.closeAction)}
|
|
14
14
|
</sd-snackbar>
|
|
15
|
-
`}renderSnackbarContent(s,t){return
|
|
16
|
-
${
|
|
17
|
-
`]}firstUpdated(t){if(super.firstUpdated(t),this.animationIn){let{keyframes:e,options:
|
|
15
|
+
`}renderSnackbarContent(s,t){return k` ${s}${t||""} `}updateQueue(){if(this._queue.length===0)return;let{direction:s,snackbar:t}=this._queue[0];s==="in"?this._rendered.length===this.maxStack?this.requestOldestSnackbarClose():(this.prepareSnackbarForRender(t),this._rendered.push(t),this.renderSnackbars(),this._queue.shift(),this.updateQueue()):this.requestSnackbarClose(t.id)}requestOldestSnackbarClose(){let s=this._rendered.find(({requestClose:t,options:e})=>!t&&e?.autoHideDuration);s&&(s.requestClose=!0,this._queue.unshift({snackbar:s,direction:"out"}),this.updateQueue())}requestSnackbarClose(s){let t=this._rendered.findIndex(e=>e.id===s);if(t!==-1){let e=this._rendered[t];e.closing||(e.requestClose=!0,window.clearTimeout(e.timer),this.closeSnackbar(t))}}closeSnackbar(s){let t=this._rendered[s],e=this.children.item(s);e&&(t.closing=!0,t.options?.waitOnHover&&e.matches(":hover")?e.addEventListener("mouseleave",()=>{e.close().then(()=>{this.removeSnackbarAndUpdate(t)})}):e.close().then(()=>{this.removeSnackbarAndUpdate(t)}))}removeSnackbarAndUpdate(s){this.removeSnackbarFromQueue(s),this.removeSnackbarFromRendered(s),this.requestUpdate(),this.updateComplete.then(()=>this.updateQueue())}removeSnackbarFromQueue(s){let t=this._queue.findIndex(({snackbar:e})=>e.id===s.id);t!==-1&&this._queue.splice(t,1)}removeSnackbarFromRendered(s){let t=this._rendered.findIndex(e=>e.id==s.id);t!==-1&&this._rendered.splice(t,1)}setupTimeoutForAutoHideSnackbar(s){s.timer=window.setTimeout(()=>{this._queue.push({snackbar:s,direction:"out"}),this.updateQueue()},s.options.autoHideDuration)}prepareSnackbarForRender(s){let{options:t,message:e}=s;if(e.slot="message",t){let{autoHideDuration:r,waitForMouseMove:i}=t;r&&(i?this.listenForMouseMove(s):this.setupTimeoutForAutoHideSnackbar(s)),this.setupAction(s)}}listenForMouseMove(s){window.addEventListener("mousemove",this.handleWindowMouseMove.bind(this,s),{once:!0})}handleWindowMouseMove(s){this.setupTimeoutForAutoHideSnackbar(s)}setupAction(s){let{options:{closeAction:t}}=s;t&&(t.addEventListener("click",()=>{this._queue.unshift({snackbar:s,direction:"out"}),this.updateQueue()}),t.slot="action")}},w.ID="sd-snackbar-provider",w.ensureDefined=()=>{Lt.ensureDefined(),customElements.get(w.ID)||customElements.define(w.ID,w)},w);Nt([dt({type:String,reflect:!0,attribute:"vertical-position"})],pt.prototype,"verticalPosition");Nt([dt({type:String,reflect:!0,attribute:"horizontal-position"})],pt.prototype,"horizontalPosition");var le=pt,U=class extends g{static get styles(){return[z`
|
|
16
|
+
${O(ne)}
|
|
17
|
+
`]}firstUpdated(t){if(super.firstUpdated(t),this.animationIn){let{keyframes:e,options:r}=this.animationIn;this.animate(e,r)}}close(){return new Promise(t=>{if(this.animationOut){let{keyframes:e,options:r}=this.animationOut,i=this.animate(e,r);i.onfinish=()=>{this.collapse(),this.addEventListener("transitionend",({propertyName:o})=>{o==="height"&&t()})}}else this.collapse(),t()})}render(){return k`
|
|
18
18
|
<div class="root">
|
|
19
19
|
<div class="message">
|
|
20
20
|
<slot name="message"></slot>
|
|
@@ -23,7 +23,7 @@ var window;(window||={})["@cas-smartdesign/snackbar"]=(()=>{var st=Object.define
|
|
|
23
23
|
<slot name="action"></slot>
|
|
24
24
|
</div>
|
|
25
25
|
</div>
|
|
26
|
-
`}collapse(){this.style.height="0",this.style.opacity="0"}};
|
|
26
|
+
`}collapse(){this.style.height="0",this.style.opacity="0"}};U.ID="sd-snackbar",U.ensureDefined=()=>{customElements.get(U.ID)||customElements.define(U.ID,U)};var Lt=U;return Vt(ce);})();
|
|
27
27
|
/*! Bundled license information:
|
|
28
28
|
|
|
29
29
|
@lit/reactive-element/css-tag.js:
|
|
@@ -34,20 +34,11 @@ var window;(window||={})["@cas-smartdesign/snackbar"]=(()=>{var st=Object.define
|
|
|
34
34
|
*)
|
|
35
35
|
|
|
36
36
|
@lit/reactive-element/reactive-element.js:
|
|
37
|
-
(**
|
|
38
|
-
* @license
|
|
39
|
-
* Copyright 2017 Google LLC
|
|
40
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
-
*)
|
|
42
|
-
|
|
43
37
|
lit-html/lit-html.js:
|
|
44
|
-
(**
|
|
45
|
-
* @license
|
|
46
|
-
* Copyright 2017 Google LLC
|
|
47
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
|
-
*)
|
|
49
|
-
|
|
50
38
|
lit-element/lit-element.js:
|
|
39
|
+
@lit/reactive-element/decorators/property.js:
|
|
40
|
+
lit-html/directive.js:
|
|
41
|
+
lit-html/directives/repeat.js:
|
|
51
42
|
(**
|
|
52
43
|
* @license
|
|
53
44
|
* Copyright 2017 Google LLC
|
|
@@ -61,20 +52,6 @@ lit-html/is-server.js:
|
|
|
61
52
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
53
|
*)
|
|
63
54
|
|
|
64
|
-
@lit/reactive-element/decorators/property.js:
|
|
65
|
-
(**
|
|
66
|
-
* @license
|
|
67
|
-
* Copyright 2017 Google LLC
|
|
68
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
69
|
-
*)
|
|
70
|
-
|
|
71
|
-
lit-html/directive.js:
|
|
72
|
-
(**
|
|
73
|
-
* @license
|
|
74
|
-
* Copyright 2017 Google LLC
|
|
75
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
76
|
-
*)
|
|
77
|
-
|
|
78
55
|
lit-html/directive-helpers.js:
|
|
79
56
|
(**
|
|
80
57
|
* @license
|
|
@@ -82,13 +59,6 @@ lit-html/directive-helpers.js:
|
|
|
82
59
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
83
60
|
*)
|
|
84
61
|
|
|
85
|
-
lit-html/directives/repeat.js:
|
|
86
|
-
(**
|
|
87
|
-
* @license
|
|
88
|
-
* Copyright 2017 Google LLC
|
|
89
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
90
|
-
*)
|
|
91
|
-
|
|
92
62
|
lit-html/directives/if-defined.js:
|
|
93
63
|
(**
|
|
94
64
|
* @license
|